24
我想将实现版本行添加到我的jar文件中的清单,以反映POM版本号。我不能为我的生活制定出如何使用jar插件来做到这一点。如何使用Maven将Implementation-Version值添加到jar清单?
这可能吗?
我想将实现版本行添加到我的jar文件中的清单,以反映POM版本号。我不能为我的生活制定出如何使用jar插件来做到这一点。如何使用Maven将Implementation-Version值添加到jar清单?
这可能吗?
你会使用Maven归档:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
这将增加以下清单文件:
Implementation-Title: ${pom.name}
Implementation-Version: ${pom.version}
Implementation-Vendor-Id: ${pom.groupId}
Implementation-Vendor: ${pom.organization.name}
$ {} buildNumber?这个变量怎么样? – dfa 2009-05-28 16:16:38
对不起,这是不需要的。我只是显示其他实现值来设置。 – Ascalonian 2009-05-28 16:18:48
感谢您的帮助! – izb 2009-05-29 08:12:06