我在maven生命周期的包阶段使用maven-assembly-plugin的jar-with-dependencies组件创建一个可执行jar。但是,我看不到配置输出jar的名称的方法。它似乎总是像
appname-1.1-r1011-jar-with-dependencies.jar
我如何将其配置为其他内容,例如
appname-1.1-r1011.jar
这可能吗?
答案 0 :(得分:23)
您可以在appendAssemblyId
中将maven-assembly-plugin
参数设置为false
,以避免“jar-with-dependencies”后缀。
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<executions>
<execution>
<id>jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>