The Manifest Update Maven Plugin is used to update the Manifest in an existing JAR File. Its goal is bound to the package in the build life cycle.
This goal will process any defined artifacts, updating the manifest contained in the artifact as defined.
In the pom.xml file, configure the plugin:
<build> <plugins> <plugin> <groupId>com.github.dkartaschew</groupId> <artifactId>manifest-update-maven-plugin</artifactId> <version>1.0.0</version> <executions> <execution> <phase>package</phase> <goals> <goal>package</goal> </goals> </execution> </executions> <configuration> <artifacts> <artifact> <publishArtifact>false</publishArtifact> <artifact>org.apache.maven:maven-plugin-api:3.5.0</artifact> <manifestFile>maven-plugin-api.mf</manifestFile> <mode>merge</mode> </artifact> </artifacts> </configuration> </plugin> ... </plugins> </build>
The above example will tie the execution to package:package allowing you to simply run:
mvn package
The configuration takes are collection of artifact in artifacts.
The available parameters for each artifact are:
The default is to not publish artifacts back into the local maven repository if the source is obtained from this source.