如何使用Maven将实现版本值添加到jar清单? [英] How do I add an Implementation-Version value to a jar manifest using Maven?
本文介绍了如何使用Maven将实现版本值添加到jar清单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将一个Implementation-Version行添加到我的jar文件中反映POM版本号的清单。我不能为我的生活如何使用jar插件解决这个问题。
I'd like to add an Implementation-Version line to a manifest in my jar file that reflects the POM version number. I can't for the life of me work out how to do this using the jar plugin.
这可能吗?
推荐答案
您将使用Maven Archiver:
You would use the Maven Archiver:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
这会将以下内容添加到清单文件中:
This will add the following to the manifest file:
Implementation-Title: ${pom.name}
Implementation-Version: ${pom.version}
Implementation-Vendor-Id: ${pom.groupId}
Implementation-Vendor: ${pom.organization.name}
这篇关于如何使用Maven将实现版本值添加到jar清单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文