<build>
<plugins>
<!-- 打包跳过test -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<!--导出所有的 jar 包 到 target lib-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copylib</id>
<!-- (打包阶段):在实际打包中,执行任何的必要的操作。 -->
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<stripVersion>false</stripVersion>
<!-- 不包含哪些jar包 -->
<!-- 只排除业务模块相关的jar包,多个用英文逗号分割 com.bdsoft.framework.gd, <excludeGroupIds>-->
</configuration>
</execution>
</executions>
</plugin>
<!-- spring boot 打包 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layout>ZIP</layout>
<!-- lib 打入那些 -->
<includes>
<include>
<!--nothing配置说明打包后不希望lib目录中有任何jar包-->
<groupId>nothing</groupId>
<artifactId>nothing</artifactId>
</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
spring boot 打包
最新推荐文章于 2024-05-15 15:01:38 发布