liian2019
2021-01-06 15:45:56 +08:00
已找到解决方案,贴上配置供大家参考
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>environment/**</exclude>
<exclude>static/**</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources/environment/${environment}</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>lib</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>lib</classifier>
<excludes>
<exclude>*.yml</exclude>
<exclude>*.xml</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludeGroupIds>org.projectlombok</excludeGroupIds>
</configuration>
</plugin>
</plugins>
</build>
第三方项目依赖时需要加入 classifier 标签
<dependency>
<groupId>com.bangdao</groupId>
<artifactId>mkplat-admin</artifactId>
<version>${mkplat.version}</version>
<classifier>lib</classifier>
</dependency>