更新时间:2022-02-15 18:02:04
Maven阴影插件通过以下配置为我工作:
Maven shade plugin worked for me with this configuration:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
只需将 Main 替换为您的主类.
要创建胖子罐,您需要调用maven package命令:
Just replace Main with your main class.
To create the fat jar you need to call maven package command:
mvn package