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