build: 修改打包配置

This commit is contained in:
xiaoyang 2021-12-17 19:53:21 +08:00
parent 6a385877ac
commit b2c67c4f15
2 changed files with 48 additions and 0 deletions

View File

@ -31,6 +31,29 @@
<build> <build>
<plugins> <plugins>
<!-- 将相同groupId的依赖模块打包进来 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>${project.groupId}:*:*</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<!--打包时去除第三方依赖--> <!--打包时去除第三方依赖-->
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -62,6 +85,7 @@
<excludeTransitive>false</excludeTransitive> <excludeTransitive>false</excludeTransitive>
<stripVersion>false</stripVersion> <stripVersion>false</stripVersion>
<includeScope>runtime</includeScope> <includeScope>runtime</includeScope>
<excludeGroupIds>${project.groupId}</excludeGroupIds>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>

View File

@ -97,6 +97,29 @@
<!-- </build>--> <!-- </build>-->
<build> <build>
<plugins> <plugins>
<!-- 将相同groupId的依赖模块打包进来 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>${project.groupId}:*:*</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<!--打包时去除第三方依赖--> <!--打包时去除第三方依赖-->
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -128,6 +151,7 @@
<excludeTransitive>false</excludeTransitive> <excludeTransitive>false</excludeTransitive>
<stripVersion>false</stripVersion> <stripVersion>false</stripVersion>
<includeScope>runtime</includeScope> <includeScope>runtime</includeScope>
<excludeGroupIds>${project.groupId}</excludeGroupIds>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>