Best Practices

We use the Versioning system to define new versions for our projects.

Project Set Up

After adding the basic configuration to the settings.xml and the pom.xml, call

mvn bugzilla:addProduct

To add the major, minor and micro milestones:

mvn bugzilla:initMilestones -DreleasedVersion=SNAPSHOT

The new project has a Bugzilla product created where the milestones 1.0.0, 0.2.0, and 0.1.0 are added, as well as the version 0.1.0-SNAPSHOT.

[INFO] Successful login to Bugzilla.
[INFO] Version '0.1.0-SNAPSHOT' already existed.
[INFO] Milestone '0.1.0' already existed.
[INFO] Milestone '0.2.0' has been created.
[INFO] Milestone '1.0.0' has been created.
[INFO] Successful logout from Bugzilla.

For convenience there is a goal to run these two steps with one single call:

mvn bugzilla:init

Release

The release of a project demands to add the version of the currently released project and to set the new milestone versions.

First update the default milestone:

mvn bugzilla:updateProduct

We want to provide a milestone for the next major, minor and micro releases to be able to add new features that break existing API, add new features without breaking existing API and add issues as bug fixes. We run (with releasedVersion set to the last released version):

mvn bugzilla:initMilestones -DreleasedVersion=0.1.0

This will create the following output (assuming that after the successful release the version in the POM is set to 0.1.1-SNAPSHOT):

[INFO] Successful login to Bugzilla.
[INFO] Version '0.1.0' has been created.
[INFO] Milestone '0.1.1' already existed.
[INFO] Milestone '0.2.0' already existed.
[INFO] Milestone '1.0.0' already existed.
[INFO] Successful logout from Bugzilla.

For convenience there is a goal to run these two steps with one single call:

mvn bugzilla:sync -DreleasedVersion=0.1.0

You may also state that the release was MICRO, MINOR, or MAJOR instead of giving the actual version number. The system will calculate the milestone versions according to these rules.

If your have access to a Nexus artifact server, the latest release version is determined by a server request by simply calling:

mvn bugzilla:sync

Release Notes

If you want to include release notes for your product you may want to have a look at the maven-issues-plugin.