如何使用Maven-assembly-plugin版本3设置最终的jar名称 [英] How to set final jar name with maven-assembly-plugin version 3
问题描述
在旧版本的插件中,您可以使用<finalName>
,但是已经不存在了.
目前,我正在获取projectName-version-jar-with-dependencies.jar,更改它会很好.
In older versions of the plugin you could use <finalName>
, but that does not exist any more.
At the moment I am getting projectName-version-jar-with-dependencies.jar and it would be nice to change this.
推荐答案
finalName
参数是在项目构建部分而不是在插件配置中设置的.
The finalName
parameter is set in the project build section and not in the plugin configuration.
从本质上说:
<build>
<finalName>xyz</finalName>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
....
</plugin>
</plugins>
</build>
assembly插件通过读取属性${project.build.finalName}
获得最终名称,并且是一个只读参数.
The assembly plugin gets the final name from reading the property ${project.build.finalName}
and is a readonly parameter.
At least that´s what the code says: http://svn.apache.org/viewvc/maven/plugins/tags/maven-assembly-plugin-3.0.0/src/main/java/org/apache/maven/plugins/assembly/mojos/AbstractAssemblyMojo.java?view=markup
这篇关于如何使用Maven-assembly-plugin版本3设置最终的jar名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!