I have a maven project structured like this:
parent
|- pom.xml
|- module1/ (extends parent)
| |- pom.xml
Inside the parent pom.xml
:
<modelVersion>4.0.0</modelVersion>
<groupId>com.company</groupId>
<artifactId>parent</artifactId>
<version>0.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>parent POM</name>
<modules>
<module>module1</module>
</modules>
And inside the module pom.xml
:
<parent>
<groupId>com.company</groupId>
<artifactId>parent</artifactId>
<version>0.0.0-SNAPSHOT</version>
</parent>
When I do a install with the parent pom, I get an error:
Could not find artifact com.company:parent:pom:0.0.0-SNAPSHOT
When I install the parent pom first, then the entire project it works:
C:\dev\parent> mvn clean install -N
C:\dev\parent> mvn clean install
How do I configure maven to install the parent pom before any modules?
I've also attempted to restructure my project like in this answer but it is still not working: https://stackoverflow.com/a/9517053/4104760