有的时候
会需要对far-jar的名字进行自定义
众所周知,jar包的名字组成为 "项目名称-版本包"
当打一个fat-jar的时候,我想名字更有个性一些,我想 "项目名称-版本包-自定义名字"
修改 shadedClassifierName 可以修改添加。
另外打fat-jar有两种方式,我这里选择使用 “maven-shade-plugin” 方式,还有 “maven-assembly-plugin”方式。
1 <?xml version="1.0" encoding="utf-8"?> 2 3 <plugin> 4 <groupId>org.apache.maven.plugins</groupId> 5 <artifactId>maven-shade-plugin</artifactId> 6 <version>3.2.0</version> 7 <executions> 8 <execution> 9 <phase>package</phase> 10 <goals> 11 <goal>shade</goal> 12 </goals> 13 </execution> 14 </executions> 15 <configuration> 16 <shadedArtifactAttached>true</shadedArtifactAttached> 17 <shadedClassifierName>自定义名称</shadedClassifierName> 18 <createDependencyReducedPom>true</createDependencyReducedPom> 19 <filters> 20 <filter> 21 <artifact>*:*</artifact> 22 <excludes> 23 <exclude>org/datanucleus/**</exclude> 24 <exclude>META-INF/*.SF</exclude> 25 <exclude>META-INF/*.DSA</exclude> 26 <exclude>META-INF/*.RSA</exclude> 27 </excludes> 28 </filter> 29 </filters> 30 </configuration> 31 </plugin>
原文地址:https://www.cnblogs.com/samad/p/12199073.html
时间: 2024-11-08 20:50:12