Apache Maven 1.x has reached its end of life, and is no longer supported. For more information, see the announcement. Users are encouraged to migrate to the current version of Apache Maven.

Sharing Plugins

You've just created a killer Maven plugin. Now what?!

Where should plugins live? Who can update them? Does it really make a difference?

Can you put my plugin in the Maven distribution?

The main Maven distribution includes many plugins, but the growing trend is for plugin owners to host the plugins themselves (What do you mean, host?). Why? There are many advantages for the plugin owners, the users, and the Maven team.

Plugin owners are the best maintainers

Since only Maven committers may update the maven-plugins repository, changes you make to your plugin will take a while to make it into a Maven distribution. Each plugin needs a committer willing to maintain it, and that plugin is not the only piece of Maven the committer works on.

Plugin owners are in a much better position to maintain the plugin. They originally wrote the plugin. They have a vested interest in seeing it succeed. If they host the plugin themselves, then updates can be incorporated quickly, and users get the benefits of updated software quicker.

This benefit is often maximized when a team that writes a library, like the StatCvs group, also creates the Maven plugin. As the library changes, the plugin may be updated to keep in sync. In fact, the Cactus and StatCvs plugins were among the first to voluntarily remove their plugins from the Maven distribution and be hosted with their respective libraries.

Publishing Your Plugin

Step 1. How do I host my Maven plugin?

To "host" a Maven plugin, you require only two things:

  • A place to keep your source code
  • A website to deploy the following
    • Your plugin's site (maven site) documentation
    • Your plugin's JAR bundles for the repository upload requests

There are a variety of options available for each need. Your source code may simply be kept on your hard drive, using a local installation of a version control tool like CVS or Subversion (you do use version control, don't you?). If you'd like to share your plugin source with others, you can request a new project at a service like SourceForge or Java.Net, or request to join an existing project like the Maven-Plugins project on SourceForge.

If you're creating a plugin for an existing open-source (or even closed-source) library, the ideal situation is to approach the library maintainers about hosting your plugin source and site. That way the plugin source is close to the people most likely to care about its success, and ensure it works well far into the future. The plugin site is located close to the already well-known library site. In the end, this cooperation means a better chance at happy users, and up-to-date plugins for everyone.

Step 2. OK. My plugin has a host, how can I put it on Maven's central repo?

If the project is part of the repository mirroring program, such as maven-plugins.sourceforge.net, publishing it at SourceForge will automatically mirror it to Maven's central repo without further work.

However, if the project is an independant, please see the instructions for uploading a resource to Maven's central repo.

NOTE: If your plugin requires resources (JAR files) that are not already in the repository, you may need to make several separate upload requests.

Step 3. My upload request was granted, but no one knows my plugin exists!

There are two ways to let your potential users know about your plugin. The first is through sending an announcement to the maven-user mailing list. Here's a few pointers on how to go about it:

  • Review an excellent announcement sent by the StatCvs group, which includes plugin installation instructions.
  • Combine the advice of the two parts to make your own effective announcement. You may like to use the Announcement Plugin to generate and perhaps mail the announcement.
  • Make sure you've subscribed to the maven-user mailing list.
  • Send your annoucement to the maven-user mailing list.

The second way to publicize your plugin is on the Maven site itself. The Maven project currently maintains a list of other sites that host plugins. Simply raise a request in JIRA to have a link added. Be sure to include the relevant information, following an existing plugin's description as an example.

Step 4. So now that they found my plugin, how do users install it?

Here's the general idea:

maven plugin:download -DartifactId=[artifactId] -DgroupId=[groupId] -Dversion=[version]

For example:

maven plugin:download -DartifactId=maven-statcvs-plugin -DgroupId=statcvs -Dversion=2.4