参考文章
How to Create an Executable JAR with Maven
利用Maven插件将依赖包、jar/war包及配置文件输出到指定目录
架构系列四:Maven实现动静分离打war包及zip包
maven打包成jar文件与打包成tar.gz文件
org.apache.maven.plugins
maven-compiler-plugin
2.3.2
1.6
org.apache.maven.plugins
maven-install-plugin
2.3.1
org.apache.maven.plugins
maven-deploy-plugin
2.5
org.apache.maven.plugins
maven-jar-plugin
2.3.1
org.apache.maven.plugins
maven-surefire-plugin
2.7.2
true
org.apache.maven.plugins
maven-source-plugin
2.1
attach-sources
jar
maven-antrun-plugin
1.8
run
org.apache.maven.plugins
maven-dependency-plugin
copy-dependencies
prepare-package
copy-dependencies
${project.build.directory}/libs
org.apache.maven.plugins
maven-jar-plugin
true
libs/
org.baeldung.executable.ExecutableMavenJar
org.apache.maven.plugins
maven-assembly-plugin
package
single
org.baeldung.executable.ExecutableMavenJar
jar-with-dependencies
org.apache.maven.plugins
maven-shade-plugin
shade
true
org.baeldung.executable.ExecutableMavenJar
com.jolira
onejar-maven-plugin
org.baeldung.executable.ExecutableMavenJar
true
${project.build.finalName}.${project.packaging}
one-jar
org.springframework.boot
spring-boot-maven-plugin
repackage
spring-boot
org.baeldung.executable.ExecutableMavenJar