Update parent version to next version

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

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

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

NOTE. This is not a multi-module project. A parent is a company / project in which all projects are inherited.

+6
source share
2 answers

I have the same problem as yours, but finally realized that it only accepts a range as input, and not a single value, so in your case you have to put:

mvn version: update-parent -DparentVersion = [1.0.1.1]

This should select 1.1 if it exists in your repository.

Got tickets for reading tips in the bug tracking plugin

+12
source

It works:

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

The reason is this: since it is expected that the parentVersion property will have a range , not one version.

Then you can set " -DparentVersion=[14,16) " as described in the -maven-plugin version, but if you want to install this version (for example, 1.0), you must define the range with only one result, using bounding brackets: [1,0].

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

This also works for the -SNAPSHOT version, unless you forget to set allowSnapshots = true

+6
source

Source: https://habr.com/ru/post/948145/


All Articles