Maven Plugin for project semantic versioning

Viewed 7654

I'm looking for a maven plugin that will help me manage version names and codes of every build that is made on our CI environment. Something that will be able to attach a prefix to the main version code or even update it (not changing the pom.xml). For example:

project version: 2.0.1
git/svn revision: 2342334

jar output: name-2.0.1-2342334.jar
maven repo: ../path/to/local/maven/repo/<package path>/2.0.1-2342334/

The main requirements to this plugin are:

  • Must be in Maven Repository (which means that NO additional setting required to add this plugin in my pom.xml and run maven)
  • Must not edit the pom, each time it's applied
  • A configuration file, would be great, so I could manage the versioning process
  • Must be able to edit the output file metadata (so the version will be applied as if it was written in the pom.xml file in the first place)

So far I found only maven-buildmetadata-pluging but unfortunately it's not in Maven Repo, so I'm stuck. Any help would be great.

3 Answers

I just would like to add (although the question is 5 years old and already has an accepted answer) that the Buildmetadata Maven Plugin was not available on the Maven Repo at first, but it is now (since late 2013). People who would like to give it a try find the artifact at the following locations :

  1. com.redhat.rcm.maven.plugin:buildmetadata-maven-plugin
  2. de.smartics.maven.plugin:buildmetadata-maven-plugin

Please note that the name has changed from maven-buildmetadata-plugin to buildmetadata-maven-plugin due to naming conventions.

I'm one of the "original" authors of this plugin at smartics. If you would like to use it, you probably would like to use the fork provided by Red Hat. To my knowledge the two versions do not differ very much and they have not been synced since there is just so much other stuff to do and the plugin seems to be feature stable. ;-)

The source code for both versions is also available on GitHub:

  1. release-engineering/buildmetadata-maven-plugin
  2. smartics/buildmetadata-maven-plugin
Related