1

In Maven, you can have one parent pom / Reactor which references child modules through the use of the parent's modules section like this:

<modules>
    <module>simple-weather</module>
    <module>simple-webapp</module>
</modules>

However, each child is free to specify or NOT its parent, and it still gets built; that means, the following piece of config is optional in for simple-weather and simple-webapp pom.xml s:

<parent>
    <groupId>org.sonatype.mavenbook.multi</groupId>
    <artifactId>simple-parent</artifactId>
    <version>1.0</version>
</parent>

When using maven-versions-plugin, and attempting to update the version of all child modules, I've found that if you're NOT specifying the parent in your child pom.xml (or if the child references a different parent), then version updates no longer propagate to the children.

Do you know why is that, and/or how I can workaround this? I should mention that I really do need to have my children pom.xmls with different parents, so it is not really an option to put the Reactor's pom.xml as their parent (for example one module is a client module which inherits from company's standard pom.xml for client modules, while the other is a server module which inherits from company's standard pom.xml for server modules).

Andrei
  • 1,613
  • 3
  • 16
  • 36
  • We have the same problem with different parent poms. We are planning to move all company parent poms into one, and activate/deactivate the different project types with profiles. – J Fabian Meier Sep 11 '17 at 11:10
  • Sorry, but I don't understand how that would work. You'd still make your child projects to have a different parent than the reactor (albeit all siblings will now share the same parent). – Andrei Sep 11 '17 at 11:16
  • 1
    No, the parent inherits from the company pom, and the child projects activate the necessary profiles. – J Fabian Meier Sep 11 '17 at 11:19

0 Answers0