This plugin helps you to create upload bundles for the central repository. A bundle that will be uploaded to the central repository has to follow certain requirements when it comes to the POM. Therefor all goals in this plugin will check that the POM includes at least the following required elements:

  • modelVersion
  • groupId
  • artifactId
  • packaging
  • name
  • version
  • description
  • url
  • licenses
  • scm (url and connection at a minimum)

Create an upload bundle for a Maven project

You can use the repository:bundle-create goal to create an upload bundle for a Maven project:

mvn repository:bundle-create

The bundle will be created in your target directory with the name: ${project.artifactId}-${project.version}-bundle.jar

If you want to include a jar with java sources in your upload (recommended, unless your license doesn't allow sources to be redistributed) the command to run is:

mvn source:jar javadoc:jar repository:bundle-create

Note: There was a bug that required you to manually add the javadoc jar to the bundle jar in version 2.0 of the plugin. This has been fixed in the 2.1 version of the plugin.

Create a bundle for a non-Maven project

The repository:bundle-pack goal is useful if you have artifacts available in your local repository that you want to create a bundle from, for an upload request. It requires that the artifact has a POM in the local repository. It will check for required elements, asking interactively for any missing values.

Note: This goal was introduced in version 2.1 of this plugin.

Simply run this command and follow the instructions on the command line. The bundle will be created in the current directory, unless you specify different values for the goal parameters.

mvn repository:bundle-pack