For reasons beyond my control, we have to use a maven project setup where the topmost pom.xml is not actually 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 like this:
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 have to:
- set the versions of root, parent, module1 and module2 to our unique build version
- set the parent versions of module1 and module2 to the same build version
- leave the version of the external parent pom intact
I see no parameters in the versions:set
mojo that do this.
Calling mvn versions:set -DnewVersion=1.2.3
sets the version for the root pom only. The exact same call works perfectly in a traditional parent / child reactor build.
Is there any possible solution?
Note:
versions:update-child-modules
is not an option, since we can't define a specific target version