1
qwerthhusn 2021-01-06 11:22:22 +08:00
有个笨方法,不知可用不可用,引入 groovy plugin,然后写 groovy 脚本处理 original jar 包
jar 包是 zip 的打包方式,直接用 zip 的方式解压开,去掉不要的文件,再压缩 |
2
liian2019 OP @qwerthhusn 谢谢你,这样有点麻烦了,想看看能不能直接通过 pom 的配置来实现
|
3
wolfie 2021-01-06 13:41:07 +08:00
<build> 扔进 <profiles> 里试试
https://stackoverflow.com/questions/48598983/making-a-maven-plugin-optional |
4
liian2019 OP 已找到解决方案,贴上配置供大家参考
<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> |