[英]rename maven jar-with-dependencies
My plugin section in the pom file looks like this:我在 pom 文件中的插件部分如下所示:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.gateway.gatewayService</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
After the build finishes, I'm left with the following files:构建完成后,我剩下以下文件:
gateway-1.1.0.pom
gateway-1.1.0.jar
gateway-1.1.0.jar-with-dependencies.jar
I would like to get the following outcome instead:我想得到以下结果:
gateway-1.1.0.pom
gateway-1.1.0.jar
gateway-1.1.0-all.jar
Which means changing gateway-1.1.0.jar-with-dependencies.jar
to gateway-1.1.0-all.jar
, is that possible?这意味着将gateway-1.1.0.jar-with-dependencies.jar
更改为gateway-1.1.0-all.jar
,这可能吗?
Remove the content删除内容
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
Of line 5,6&7 and then try. 5,6&7行的然后试试。
You need to add two tags which are <finalName>
and <appendAssemblyId>
inside <configuration>
您需要在 < <configuration>
> 中添加<finalName>
和<appendAssemblyId>
两个标签
Set <appendAssemblyId>
to false
将<appendAssemblyId>
设置为false
You need to change your maven-assembly-plugin
as below您需要如下更改您的maven-assembly-plugin
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<finalName>all</finalName> // name of your jar
<appendAssemblyId>false</appendAssemblyId> // append will be false
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.gateway.gatewayService</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.