How to install versions in non-standard maven reactor assembly?

For reasons beyond my control, we should use the maven project setup, where the topmost pom.xml is not really the parent pom. Now we would like to create a Jenkins deployment pipeline, which, of course, would deploy a unique version of the entire reactor to our nexus repository.

Our setup is as follows:

root (no parent pom)
 +---- parent  (company-wide parent pom is somewhere else)
 +---- module1 (parent pom is ../parent/pom.xml)
 +---- module2 (parent pom is ../parent/pom.xml)

Now we must:

  • install root, parent, module1 and module2 versions in our unique build version
  • install the parent versions of module1 and module2 in the same build version
  • leave the version of the external parent pump intact

I do not see the parameters in versions:setmojo that do this. The call mvn versions:set -DnewVersion=1.2.3sets the version for the root pump only. The same challenge works fine in a traditional assembly of parent / child reactors.

Is there a possible solution?

Note: This is versions:update-child-modulesnot an option because we cannot determine a specific target version.

+4
source share
1 answer

This was stated on the mailing list and reported ( MVERSIONS-131 ) with the conclusion that it is best to deal with support for wildcards:

mvn versions:set -DgroupId='*' -DartifactId='*' -DoldVersion='*' -DnewVersion=1.2-SNAPSHOT

MVERSIONS-228; , , (2.1) versions-maven-plugin.

+4

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


All Articles