1.打包时附加外部Jar包
maven-compiler-plugin
3.5.1
1.7
1.7
UTF-8
${project.basedir}/libs
2.打包时附加源码
org.apache.maven.plugins
maven-source-plugin
2.2.1
package
jar-no-fork
3.pom依赖打包
org.apache.maven.plugins
maven-assembly-plugin
2.5.4
${exec.mainClass}
-->
jar-with-dependencies
make-assembly
package
single
打包依赖的class文件命令:
mvn assembly:assembly
如果不希望依赖的JAR包变成CLASS
可以修改ASSEMBLY插件.本地地址一般是 ${user_home}\.m2\org\apache\maven\plugins\maven-assembly-plugin\2.4
打开此目录下的maven-assembly-plugin-2.4.jar,找到assemblies\jar-with-dependencies.xml 把里面的UNPACK改成FALSE即可
网友评论