1

I encountered a multi module Maven project where the parent defines some child modules in the pom, but some of the child modules reference another parent. Something like this:

parent pom:

<groupId>test</groupId>
<artifactId>parentAAA</artifactId>
<packaging>pom</packaging>
<version>1.0</version>

<modules>
    <module>module1</module>
    <module>module2</module>
    <module>module3</module>
</modules>

module1 pom:

<parent>
    <groupId>test</groupId>
    <artifactId>parentBBB</artifactId>
    <version>2.0</version>
</parent>

<groupId>test</groupId>
<artifactId>module1</artifactId>
<version>1.0</version>

The project builds with maven 3.6.3 but the versions plugin fails.

Is such a configuration correct? (My assumption is that is isn't)

Alina Danila
  • 1,683
  • 1
  • 24
  • 60
  • 1
    there is nothing wrong with such structure, check for example [Module inheritance vs aggregation](https://stackoverflow.com/questions/17482320/module-inheritance-vs-aggregation), however some plugins may not expect that. If you are experiencing difficulties with versions plugin that is worth to provide error and stacktrace. – Andrey B. Panfilov Aug 30 '22 at 12:30

0 Answers0