Maven jar plugin

1.修改pom.xml增加如下内容

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  
 <plugin> <groupId>org.apache.maven.plugins</groupId>

   
<artifactId>maven-jar-plugin</artifactId>
   
<version>2.4</version>
   
<configuration>
   

   
<manifest>
   
true</addClasspath>
   
<classpathPrefix>lib/</classpathPrefix>
   
<mainClass>com.sysware.HelloWorld</mainClass>
   
</manifest>
   
</archive>
   
</configuration> </plugin> 

运行mvn clean package即可

html

…src/main/java

src/main/resources

${project.build.directory}

org.apache.maven.plugins

maven-compiler-plugin

lib1.6

1.6

UTF-8

org.apache.maven.plugins

maven-jar-plugin

true

lib/

…..MonitorMain

org.apache.maven.plugins

maven-dependency-plugin

copy package

copy-dependencies

${project.build.directory}/lib

org.apache.maven.plugins

maven-resources-plugin

2.3

UTF-8

maven-source-plugin

2.1

true

UTF-8

compile

jar

html

${project.build.directory}/classes

src/main/resources

true

**/*.xml

org.apache.maven.plugins

maven-compiler-plugin

3.0

1.6

1.6

UTF-8

org.apache.maven.plugins

maven-shade-plugin

2.0

package

shade

com.test.testguava.app.App

applicationContext.xml

true

executable

地址: http://blog.csdn.net/johnnywww/article/details/7964326

上一篇Eclipse Fat jar 插件地址

下一篇Java 高手之路笔记 (1)

http://blog.csdn.net/zhangdaiscott/article/details/6911640

http://blog.csdn.net/johnnywww/article/details/7964326