MANIFEST.MF
jar パッケージ化されたアーティファクトと test-jar-packaged 用に異なるファイルを作成しようとしています。に追加のmaven-jar-plugin
ものを追加するために使用されているMANIFEST.MF
- これまでのところ完全に機能します。しかし、テストプロジェクト用に別のテンプレート ファイルを選択したい場合MANIFEST.MF
、Maven は両方のアーティファクトに対して 2 番目に参照されるテンプレートのみを使用します...
PROD-MANIFEST.MF-template
Maven で を通常の jar-packaging とTEST-MANIFEST.MF-template
を test-jar-packagingに使用するにはどうすればよいですか?
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>test-manifest-mf</id>
<phase>package</phase>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
<manifestFile>foo/TEST-MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-manifest-mf</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
<manifestFile>foo/PROD-MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>