mavenmodulebuild-automationparent-child

Maven: Non-resolvable parent POM


I have my maven project setup as 1 shell projects and 4 children modules. When I try to build the shell. I get:

[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR] The project module1:1.0_A0 (C:\module1\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find shell:pom:1.0_A0 in http://nyhub1.ny.ssmb.com:8081/nexus/content/repositories/JBoss/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 5, column 11 -> [Help 2]

If I try to build a lone module I get the same error only replace module1, with whatever module it was.

Have them all referencing the parent in their poms.

<parent>
    <artifactId>shell</artifactId>
    <groupId>converter</groupId>
    <version>1.0_A0</version>
</parent>

Here is the relevant parts of the shell pom:

<groupId>converter</groupId>
<artifactId>shell</artifactId>
<version>1.0_A0</version>
<packaging>pom</packaging>
<name>shell</name>


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

Solution

  • Just for reference.

    The joys of Maven.

    In the pom.xml of the child modules, setting the relative path of the to ../pom.xml solved it.

    The parent element has a relativePath element that you need to point to the directory of the parent. It defaults to ..

    <parent>
        <artifactId>shell</artifactId>
        <groupId>converter</groupId>
        <version>1.0_A0</version>
        <relativePath>..</relativePath>   <!-- THIS -->
    </parent>