<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<!-- 打包时执行可执行 jar 包的入口类(MainClass),打包后的可执行 jar 包名称:aliyun-ddns-jar-with-dependencies.jar -->
<manifest>
<mainClass>com.xxxx.App</mainClass>
</manifest>
</archive>
<descriptorRefs>
// 依赖打包至同一个jar包中
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<!-- 打包绑定于maven package 生命周期,在package阶段同时打包可执行jar -->
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
网友评论