JAR ファイルのマニフェストに、POM バージョン番号を反映する Implementation-Version 行を追加したいと考えています。私は一生、jar プラグインを使用してこれを行う方法を考え出すことはできません。
これは可能ですか?
JAR ファイルのマニフェストに、POM バージョン番号を反映する 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}