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

[xml]

  org.apache.maven.plugins

maven-jar-plugin

2.4

true

lib/

com.sysware.HelloWorld

[/xml]

运行mvn clean package即可

2.在pom.xml增加如下内容

[html][/html]

view plaincopy org.apache.maven.plugins

maven-assembly-plugin

2.3

false

jar-with-dependencies

com.juvenxu.mvnbook.helloworld.HelloWorld

make-assembly package

assembly

运行mvn assembly:assembly

 

 

[html][/html]

view plaincopy

…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][/html]

view plaincopy

${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