I faced this situation: when packing a project using maven, I would like both the source package and the binary package, and they have the same manifest.mf file. Then I have to write the same entry in the plugin configuration maven-source-plugin and maven-jar-plugin, for example:
<plugins>
<plugin>
<artifactId> maven-source-plugin </artifactId>
<executions>
<execution>
<id> attach-sources </id>
<goals>
<goal> jar </goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifestEntries>
<Artifiact> $ {project.name} </Artifiact>
<Version> $ {project.version} </Version>
<Vendor> $ {project.organization.name} </Vendor>
<Built-By> Shiva Wu </Built-By>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId> maven-jar-plugin </artifactId>
<configuration>
<archive>
<addMavenDescriptor> false </addMavenDescriptor>
<manifestEntries>
<Artifiact> $ {project.name} </Artifiact>
<Version> $ {project.version} </Version>
<Vendor> $ {project.organization.name} </Vendor>
<Built-By> Shiva Wu </Built-By>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
It is not possible to change both of them when changing settings. Is there a better way to solve this problem?
Thanks:)
source share