如何使用maven pom.xml创建jar
我需要一个示例pom文件来为我的spring项目创建一个jar文件。如何指定在创建jar文件时为资源创建目录和文件夹。我可以使用pom创建jar文件。但是我需要在jar文件中包含applicationContext.xml如何使用maven pom.xml创建jar,maven,jar,pom.xml,Maven,Jar,Pom.xml,我需要一个示例pom文件来为我的spring项目创建一个jar文件。如何指定在创建jar文件时为资源创建目录和文件夹。我可以使用pom创建jar文件。但是我需要在jar文件中包含applicationContext.xml 如何在maven中执行此操作?说明了如何执行此操作 这篇文章详细介绍了这个pom,它使用maven jar插件来实现,我在以前的工作中编写了许多pom,看起来几乎与此相同。希望这有帮助 4.0.0 org.foo 我的应用程序 罐子 1.0-快照 我的应用程序 http:/
如何在maven中执行此操作?说明了如何执行此操作 这篇文章详细介绍了这个pom,它使用maven jar插件来实现,我在以前的工作中编写了许多pom,看起来几乎与此相同。希望这有帮助
4.0.0
org.foo
我的应用程序
罐子
1.0-快照
我的应用程序
http://maven.apache.org
org.apache.maven.plugins
maven编译器插件
org.apache.maven.plugins
maven eclipse插件
org.apache.maven.plugins
maven jar插件
真的
org.foo.App
org.apache.maven.plugins
maven surefire插件
朱尼特
朱尼特
3.8.1
测试
Maven使用约定优先于配置,因此所有标准Maven项目都具有相同的特性。由于应用程序上下文文件是一个资源,您应该将其放入src/main/resources
文件夹(或其子文件夹之一)。http://maven.apache.org/maven-v4_0_0.xsd">
4.0.0
com.tridenthyundai.ains
现代三叉戟
战争
1.0-快照
三叉戟现代Maven网络应用程序
3.0.5.1发布
4.11
1.7
8.1.8.v20121106
org.springframework
弹簧芯
${spring.version}
org.springframework
弹簧网
${spring.version}
org.springframework
SpringWebMVC
${spring.version}
文件上传
文件上传
1.2.2
org.apache.commons
公地io
1.3.2
朱尼特
朱尼特
${junit.version}
测试
jstl
jstl
1.2
javax.servlet
javax.servlet-api
3.0.1
javax.servlet
jsp api
2
假如
log4j
log4j
1.2.9
org.eclipse.persistence
日食
2.0.0
org.eclipse.persistence
javax.persistence
2.0.0
mysql
mysql连接器java
5.1.17
org.json
json
20090211
现代三叉戟
org.apache.maven.plugins
maven编译器插件
3
${jdk.version}
${jdk.version}
org.mortbay.jetty
jetty maven插件
${jetty.version}
org.apache.tomcat.maven
tomcat7 maven插件
2.1
http://mobile.saptalabs.com/manager/text
/现代三叉戟
用户
密码
4.0.0
com.sapta.hr
人力资源网
战争
1.0-快照
Saptalabs HR Maven Webapp
http://maven.apache.org
日食
http://download.eclipse.org/rt/eclipselink/maven.repo/
释放
释放
https://oss.sonatype.org/content/repositories/releases
3.0.5.1发布
4.11
1.7
8.1.8.v20121106
org.springframework
弹簧芯
${spring.version}
org.springframework
弹簧网
${spring.version}
org.springframework
SpringWebMVC
${spring.version}
com.itextpdf
itextpdf
5.0.6
org.apache.poi
poi
3.9
org.apache.poi
poi ooxml
3.7
文件上传
文件上传
1.2.2
org.apache.commons
公地io
1.3.2
朱尼特
朱尼特
${junit.version}
测试
jstl
jstl
1.2
通用编解码器
通用编解码器
1.2
javax.servlet
javax.servlet-api
3.0.1
javax.servlet
jsp api
2
假如
log4j
log4j
1.2.9
org.eclipse.persistence
日食
2.0.0
org.eclipse.persistence
javax.persistence
2.0.0
mysql
mysql连接器java
5.1.17
org.json
json
20090211
com.googlecode.json-simple
简单json
1.1.1
javax.mail
邮件
1.4.3
com.googlecode.mp4parser
等参线
1.0-RC-27
com.sapta.hr
普通
1.0-快照
舌骨
org.apache.maven.plugins
maven编译器插件
3
${jdk.version}
${jdk.version}
org.mortbay.jetty
<!-- <repositories> <repository> <id>eclipselink</id> <url>http://download.eclipse.org/rt/eclipselink/maven.repo/</url>
</repository> </repositories> -->
<properties>
<spring.version>3.0.5.RELEASE</spring.version>
<junit.version>4.11</junit.version>
<jdk.version>1.7</jdk.version>
<jetty.version>8.1.8.v20121106</jetty.version>
</properties>
<dependencies>
<!-- Spring 3 dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Apache Commons file upload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version>
</dependency>
<!-- Apache Commons IO -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.9</version>
</dependency>
<!-- See http://wiki.eclipse.org/EclipseLink/Maven -->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.0.0</version>
</dependency>
<!-- optional - only needed if you are using JPA outside of a Java EE container -->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.17</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
</dependencies>
<build>
<finalName>tridenthyundai</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
</plugin>
<!-- LOCAL Maven Tomcat Plugin -->
<!-- <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version> <configuration> <url>http://localhost:8080/manager/text</url>
<path>/tridenthyundai</path> <username>admin</username> <password>admin</password>
</configuration> </plugin> -->
<!-- PRODUCTION Maven Tomcat Plugin -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<url>http://mobile.saptalabs.com/manager/text</url>
<path>/tridenthyundai</path>
<username>user</username>
<password>passcode</password>
</configuration>
</plugin>
</plugins>
</build>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sapta.hr</groupId>
<artifactId>hrweb</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>Saptalabs HR Maven Webapp</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>eclipselink</id>
<url>http://download.eclipse.org/rt/eclipselink/maven.repo/</url>
</repository>
<repository>
<id>releases</id>
<name>Releases</name>
<url>https://oss.sonatype.org/content/repositories/releases</url>
</repository>
</repositories>
<properties>
<spring.version>3.0.5.RELEASE</spring.version>
<junit.version>4.11</junit.version>
<jdk.version>1.7</jdk.version>
<jetty.version>8.1.8.v20121106</jetty.version>
</properties>
<dependencies>
<!-- Spring 3 dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.7</version>
</dependency>
<!-- Apache Commons file upload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version>
</dependency>
<!-- Apache Commons IO -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.9</version>
</dependency>
<!-- See http://wiki.eclipse.org/EclipseLink/Maven -->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.0.0</version>
</dependency>
<!-- optional - only needed if you are using JPA outside of a Java EE container -->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.17</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.3</version>
</dependency>
<dependency>
<groupId>com.googlecode.mp4parser</groupId>
<artifactId>isoparser</artifactId>
<version>1.0-RC-27</version>
</dependency>
<dependency>
<groupId>com.sapta.hr</groupId>
<artifactId>hrcommon</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>saptalabs</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<url>http://localhost:8081/manager/text</url>
<path>/saptalabs</path>
<username>admin</username>
<password>admin</password>
</configuration>
</plugin>
</plugins>
</build>
</project>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>MainClass</mainClass>
</manifest>
</archive>
</configuration>
</plugin>