重命名带有依赖项的 Maven jar
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>
构建完成后,我留下以下文件:
gateway-1.1.0.pom
gateway-1.1.0.jar
gateway-1.1.0.jar-with-dependencies.jar
我想得到以下结果:
gateway-1.1.0.pom
gateway-1.1.0.jar
gateway-1.1.0-all.jar
这意味着更改 gateway-1.1.0.jar-with -dependency.jar
到 gateway-1.1.0-all.jar
,这可能吗?
My plugin section in the pom file looks like this:
<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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
内容然后尝试。
删除第5,6&7行的
Remove the content
Of line 5,6&7 and then try.
您需要在
内添加两个标签,分别是
和Set
;
为false
您需要更改您的
maven-assemble-plugin
如下You need to add two tags which are
<finalName>
and<appendAssemblyId>
inside<configuration>
Set
<appendAssemblyId>
tofalse
You need to change your
maven-assembly-plugin
as below