如何使用Maven将实现版本值添加到jar清单?

我想将一个Implementation-Version行添加到我的jar文件中反映POM版本号的清单。 我不能为我的生活解决如何使用jar插件来做到这一点。

这可能吗?

你会使用Maven Archiver:

  org.apache.maven.plugins maven-jar-plugin    true      

这会将以下内容添加到清单文件中:

 Implementation-Title: ${pom.name} Implementation-Version: ${pom.version} Implementation-Vendor-Id: ${pom.groupId} Implementation-Vendor: ${pom.organization.name}