Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

update parent version to next release version

Tags:

maven

http://mojo.codehaus.org/versions-maven-plugin/update-properties-mojo.html

The Maven versions plugin versions:update-parent only updates to the latest snapshot or release version.

However, I am currently on 1.1-SNAPSHOT and I have 1.1 and 2.0 versions of this parent. How can I update to 1.1?

NOTE: This is not a multi-module project. The parent is a company/project wide pom all projects inherit.

like image 563
DarVar Avatar asked Jun 26 '13 13:06

DarVar


People also ask

What is versions Maven plugin?

The Versions Maven Plugin is a Maven plugin which provides you the information of which libraries could be updated.


2 Answers

I got the same problem as you, but finally understood it was only accepting a range as input, not a single value, so in your case you should put:

mvn versions:update-parent -DparentVersion=[1.0,1.1]

This should select 1.1 if it exists in your repository.

Got the clue reading tickets in plugin bug tracker

like image 110
Gurvan Avatar answered Oct 07 '22 02:10

Gurvan


This works:

mvn versions:update-parent -DparentVersion=[1.1]

The reason is : because the parentVersion property is expected to be a range, not a single version.

Then you can set "-DparentVersion=[14,16)" as documented in versions-maven-plugin, but if you want to set a given version (eg 1.0), you must define a range with only one result, using bounding brackets : [1.0].

See versions range specification: http://maven.apache.org/enforcer/enforcer-rules/versionRanges.html

This also works for a -SNAPSHOT version if you don't forget to set allowSnapshots=true

like image 28
LEVALLEUX Avatar answered Oct 07 '22 02:10

LEVALLEUX