0

I have a multi module project with two POMs, one aggregates the modules the other one is the parent of the modules.

<groupId>company</groupId>
<artifactId>aggregator-pom</groupId>
<version>1.0.0</version>

<modules>
  <module>module-A</module>
  <module>module-B</module>
</modules>

Child module pom looks like:

<parent>
 <groupId>company</groupId>
 <artifactId>parent-pom</artificatId>
 <version>2.0.0</version>
</parent>

<groupId>company</groupId>
<artifactId>module-A</artificatId>
<version>1.1.0</version>

I want to execute versions:set on the aggregator-project to update the versions on the modules (A, B), but it seems that the versions plugin does not support this use case. The excat call is:

build-helper:parse-version  versions:set -DnewVersion=${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}-${SVN_REVISION}

So the intention is that the build-helper plugin reads the current version with the help of jenkins we append the svn revision number to the version. This should be done on every module defined in the aggregator project. If I call this for just one independent project it works well. If the versions-plugin does not support this use case how can I achieve this?

desert
  • 11
  • 4
  • Why your aggregator pom has different version then the child modules? Those should be the same for the versions:set to make sense (and probably work). – Krzysztof Krasoń Aug 04 '16 at 07:41
  • Because some modules have a different lifecycle, think of an API which will be used by other developers. Are there alternatives to the versions plugin to achieve this? – desert Aug 04 '16 at 07:50
  • 1
    If modules have different life cycles they should not be part of a multi module build. You can use the -N option of versions-maven-plugin:set and see details in the docs. – khmarbaise Aug 04 '16 at 07:57
  • @desert So what should versions:set do? Change which versions? How should it now which ones you want it to change? – Krzysztof Krasoń Aug 04 '16 at 08:05
  • versions:set should change all module (A, B) numbers in such way that the current svn revision number is appended. Using versions-plugin is not necessary for me, I want to achieve this behaviour maybe with another plugin or tool. I know that normally in a multi module project all modules should have the same number like the aggregator-pom but for me it does not make sense to update the API version if just one module A changes, because the API will be used by other developers. So they will ask for the release changes if they see another version. – desert Aug 04 '16 at 08:10

0 Answers0