Reputation: 20182
I am using apache maven 3.1.0 (after quite some time) on windows for a project put together by somebody else. I have a parent pom & multiple child pom xml files. The child pom contains the following which is causing an issue when I run mvn clean install:
<parent>
<groupId>com.test.platform</groupId>
<artifactId>test-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
The error I get from mvn -e points to a dependency issue due to inability to find the artifact (referring to the 0.0.1-SNAPSHOT). I am not sure if I am missing a step or need to change something with my project/pom xml files. Any useful suggestions would be welcome (I can post more detailed error messages if needed). Thanks!
Update: I have also tried adding a relative path to the child pom xml file though its still giving me an error.
Directory Structure:
Main Directory -> pom.xml file
Child Directory -> pom.xml file (with parent tag) - I added the relative section to it as well.
Upvotes: 0
Views: 2398
Reputation: 26574
Interesting that the Introduction to the POM shows the relativePath as pointing directly to the pom.xml file, whereas the POM reference shows the relativePath pointing to the parent module/project, and not to the pom. Perhaps it supports both, but I can tell you that the project I'm looking at now (which works) has <relativePath>../myParentProject</relativePath>
Perhaps you could try to set the relative path in your project to ../
Of course, this all assumes that the answer to the question of whether 0.0.1-SNAPSHOT of the parent actually exists in your repository is YES.
Upvotes: 1