一般Java项目都会依赖其他
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>com.meiyou.topword.App</Main-Class>
<X-Compile-Source-JDK>${maven.compile.source}</X-Compile-Source-JDK>
<X-Compile-Target-JDK>${maven.compile.target}</X-Compile-Target-JDK>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
第三方jar包,最终打包时,希望把其他jar包包含在一个jar包里

本文介绍如何使用Maven shade插件将Java项目中的第三方jar包整合到一个单独的jar中,配置了Manifest资源Transformer来指定主类和JDK版本。

4074

被折叠的 条评论
为什么被折叠?



