如何使用Maven-assembly-plugin版本3设置最终的jar名称 [英] How to set final jar name with maven-assembly-plugin version 3

查看:1434
本文介绍了如何使用Maven-assembly-plugin版本3设置最终的jar名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在旧版本的插件中,您可以使用<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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆