How to set final jar name with maven-assembly-plugin version 3

≯℡__Kan透↙ 提交于 2019-12-07 03:53:59

问题


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.


回答1:


The finalName parameter is set in the project build section and not in the plugin configuration.

so essentially:

<build>
   <finalName>xyz</finalName>
   <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        ....
      </plugin>
   </plugins>
</build>

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



来源:https://stackoverflow.com/questions/45101044/how-to-set-final-jar-name-with-maven-assembly-plugin-version-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!