2

Is it possible to create a release candidate from my current maven project without changing the version number in the pom.xml?

I just want to build a new maven artifact form my project with a specific version number.

For example: my current pom.xml has the version '0.0.1'. I have called mvn install to create the artifact in my local repository. Now I would like to create a second artifact with the version '0.0.1-RC1'

Is this possible from the mvn command line without changing the version number in my pom.xml?

Rob Kielty
  • 7,958
  • 8
  • 39
  • 51
Ralph
  • 4,500
  • 9
  • 48
  • 87

2 Answers2

12

I would advice against your suggestion of not changing the version number. One of the Maven's benefits is to keep your releases in sequence, i.e. after you have made your '0.0.1-RC1' candidate you will continue to work on the '0.0.1-RC2-SNAPSHOT' version (which may result in a '0.0.1-RELEASE').

That said, you don't have to change the version number manually. The Maven Release Plugin offers great help with this with commands such as mvn release:prepare and mvn release:perform. Also read the Maven build versions in the Maven reference manual. You may also find the discussion about Maven version scheme interesting.

Community
  • 1
  • 1
matsev
  • 32,104
  • 16
  • 121
  • 156
  • thanks. mvan release helps me to get the things done. I use just the release:prepare and release:clean goal to tag the last version and start with a new developer version. I did no use the release:perform goal as I have no official mvn repository. – Ralph Dec 04 '11 at 12:43
2

As I see it you have two options:

  1. Embrace the release plug-in. It's been designed to address this problem.
  2. Use the versions plug-in and issue your own source code control commands.
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185