Fork me on GitHub

manifest-update:package

Full name:

com.github.dkartaschew:manifest-update-maven-plugin:1.0.0:package

Description:

Rebuild defined artifacts or JARs, updating the included manifest with details from the provided supplemental manifest.

Attributes:

  • Requires a Maven project to be executed.
  • Binds by default to the lifecycle phase: package.

Required Parameters

Name Type Since Description
<artifacts> List - List of all artifacts/JAR files to update.

Each artifact must define either a local maven artifact (artifact) or a JAR File (jarFile) and a supplemental manifest file.

Artifact is defined as:

<artifacts>
<artifact>
  <artifact>org.apache.maven:maven-plugin-api:3.5.0</artifact>
  <jarFile>org.apache.maven.maven-plugin-api-3.5.0.jar</jarFile>
  <manifestFile>src/manifests/maven-plugin-api.mf</manifestFile>
  <mode>merge</mode>
  <publishArtifact>false</publishArtifact>
</artifact>
...
</artifacts>

artifact defines a JAR file located in the local maven repository. The format definition uses Apache Buildr notation. (This is effectively groupId:artifactId:version).

jarFile defines a local JAR file.

manifestFile defines the supplemental manifest file that will update the manifest in the JAR file. The provided manifest file must conform to the JAR Manifest specification.

mode and publishArtifact are optional.

mode can be set to "merge" or "overwrite". "merge" will instruct the plugin to merge the contents of the original and supplement manifest, and "overwrite" will replace the original with the supplement manifest. (Defaults to "merge").

publishArtifact can be set to "true" or "false". This setting instructs the plugin to republish an updated JAR back into the local maven repository post processing. This setting has no effect if the JAR file being updated did not originate from the local maven repository. (Defaults to "false").


Optional Parameters

Name Type Since Description
<localRepository> File - The location of the local maven repository.
Default value is: ${settings.localRepository}.
<outputDirectory> File - Target location to store files.
Default value is: ${project.build.directory}.

Parameter Details

<artifacts>

List of all artifacts/JAR files to update.

Each artifact must define either a local maven artifact (artifact) or a JAR File (jarFile) and a supplemental manifest file.

Artifact is defined as:

<artifacts>
<artifact>
  <artifact>org.apache.maven:maven-plugin-api:3.5.0</artifact>
  <jarFile>org.apache.maven.maven-plugin-api-3.5.0.jar</jarFile>
  <manifestFile>src/manifests/maven-plugin-api.mf</manifestFile>
  <mode>merge</mode>
  <publishArtifact>false</publishArtifact>
</artifact>
...
</artifacts>

artifact defines a JAR file located in the local maven repository. The format definition uses Apache Buildr notation. (This is effectively groupId:artifactId:version).

jarFile defines a local JAR file.

manifestFile defines the supplemental manifest file that will update the manifest in the JAR file. The provided manifest file must conform to the JAR Manifest specification.

mode and publishArtifact are optional.

mode can be set to "merge" or "overwrite". "merge" will instruct the plugin to merge the contents of the original and supplement manifest, and "overwrite" will replace the original with the supplement manifest. (Defaults to "merge").

publishArtifact can be set to "true" or "false". This setting instructs the plugin to republish an updated JAR back into the local maven repository post processing. This setting has no effect if the JAR file being updated did not originate from the local maven repository. (Defaults to "false").

  • Type: java.util.List
  • Required: Yes

<localRepository>

The location of the local maven repository.
  • Type: java.io.File
  • Required: No
  • Default: ${settings.localRepository}

<outputDirectory>

Target location to store files.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}