I'm trying to create an aggregate POM to build all our projects from a clean slate. Let's say I have a parent project and 2 code projects. These are all in different source trees.
Parent:
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
Project A:
<parent>
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath/>
</parent>
<artifactId>project-A</artifactId>
<packaging>jar</packaging>
Project B:
<parent>
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath/>
</parent>
<artifactId>project-B</artifactId>
<packaging>jar</packaging>
Now I'm trying to create a separate aggregator POM to build all of these together, like so:
<groupId>com.example</groupId>
<artifactId>aggregator</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>path/to/parent</module>
<module>path/to/project-A</module>
<module>path/to/project-B</module>
</modules>
mvn clean install
on the aggregator
project fails, because the reactor cannot find the <parent>
of the two code projects. The reason is obvious - the parent
project is part of the reactor and so the artifact does not exist at the start of the build.
Is there a way to achieve this reactor build?