Guide to Testing Development Versions of Plugins

Why would I want to do this?

If a bug you are encountering has been reported as fixed but not yet released, you can confirm that it has been fixed for you. Or perhaps you just like to live on the bleeding edge.

Note: This is not recommended as an everyday or in production practice!

How do I do this?

Development versions of Maven plugins are periodically published to the repository: http://people.apache.org/repo/m2-snapshot-repository/

Note: Currently, this is not done automatically by our continuous integration setup. This is coming soon.

The first step is to include this in your project:

<project>
  ...
  <pluginRepositories>
    <pluginRepository>
      <id>snapshots</id>
      <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
    </pluginRepository>
  </pluginRepositories>
  ...
</project>

Note: If you are using the goals from the command line on a number of projects, you should include this in your settings.xml file instead. See Guide to configuring Maven for more info.

After this is included, there are three ways to use the updated versions:

  • Set the appropriate version in the plugin, eg 2.0.1-SNAPSHOT
  • If you have not specified a version, use the -U switch to update plugins for the given Maven run
  • You can have Maven automatically check for updates on a given interval, for example:
    <project>
      ...
      <pluginRepositories>
        <pluginRepository>
          <id>snapshots</id>
          <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
          <!-- The releases element here is due to an issue in Maven 2.0 that will be
               fixed in future releases. This should be able to be disabled altogether. -->
          <releases>
            <updatePolicy>daily</updatePolicy>
          </releases>
          <snapshots>
            <updatePolicy>daily</updatePolicy>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
      ...
    </project>
    

Note: These last two techniques mean that every plugin will be updated to the latest snapshot version. Finer grained control will be available in future versions.

How do I stop doing this?

The development version will stop being used if the <pluginRepository> element is removed from your POM or settings.xml (regardless of what is in your local repository).

How do I make changes to the source and test development versions of the plugins?

For information on this, see the Guide to Maven 2.0 Development.