[maven] 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>

This question is related to maven module build-automation parent-child

The answer is


Just for reference.

The joys of Maven.

Putting the relative path of the modules 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 ..


I had the issue that two reactor build pom.xml files had the same artefactId.


Alternative reason also might be the parent artifact comes from repository which is not accessible from pom.xml, typically private repository. The solution was to provide that repository in pom.xml:

<repositories>
    <repository>
        <id>internal-repo</id>
        <name>internal repository</name>
        <url>https://my/private/repo</url>
        <layout>default</layout>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

In my case the problem was even more complicated due to Eclipse: the repository was active only in special profile (<profiles><profile><id>activate-private-repo</id><repositories>...) and Maven GUI in Eclipse didn't allow to set this profile through Ctrl+Alt+P shortcut.

The solution was to temporarily declare repository outside profile (unconditionally), launch Alt+F5 Maven Update Project, activate profile and put repository declaration back into profile. This is rather Eclipse bug, not Maven bug.


I had similar problem at my work.

Building the parent project without dependency created parent_project.pom file in the .m2 folder.

Then add the child module in the parent POM and run Maven build.

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

Non-resolvable parent POM: This means you cannot resolve the parent repo.

Trun on debug mode:

[DEBUG] Reading global settings from **/usr/local/Cellar/maven/3.5.4/libexec/conf/settings.xml**
[DEBUG] **Reading user settings from /Users/username/.m2/settings.xml**
[DEBUG] Reading global toolchains from /usr/local/Cellar/maven/3.5.4/libexec/conf/toolchains.xml
[DEBUG] Reading user toolchains from /Users/username/.m2/toolchains.xml
[DEBUG] Using local repository at /Users/username/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /Users/username/.m2/repository
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:

Because the parent repo is not part of the maven central. The solution is specify a setting.xml in ~m2/ to help result the parent POM. /Users/username/.m2/settings.xml

In that XML, you might need to specify the repository information.


<relativePath>

If you build under a child project, then <relativePath> can help you resolve the parent pom.

install parent pom

But if you build the child project out of its folder, <relativePath> doesn't work. You can install the parent pom into your local repository first, then build the child project.


It was fixed when I removed settings.xml from .m2 folder.


Add a Dependency in

pom.xml:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.8.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.4.3</version>
</dependency>

I solved that problem on me after a very long try, I created another file named "parent_pom.xml" in child module file directory at local and pasted contents of parent_pom.xml,which is located at remote, to newly created "parent_pom.xml". It worked for me and error message has gone.


It can also be fixed by putting the correct settings.xml file into the ~/.m2/ directory.


verify if You have correct values in child POMs

GroupId
ArtefactId
Version

In Eclipse, for example, You can search for it: Eclipse: search parent pom


Inside relative path tag do as follows

<relative>{project_name}/pom.xml</relative>

and then RunAs-> Maven build

It worked for me.


Replace 1.0_A0 with ${project.version}

Run mvn once. This will download all the required repositories. You may switch back to 1.0_A0 after this step.


Just add <relativePath /> so the parent in pom should look like:

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.4.RELEASE</version>
        <relativePath />
    </parent>

Examples related to maven

Maven dependencies are failing with a 501 error Why am I getting Unknown error in line 1 of pom.xml? Why am I getting "Received fatal alert: protocol_version" or "peer not authenticated" from Maven Central? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Unable to compile simple Java 10 / Java 11 project with Maven ERROR Source option 1.5 is no longer supported. Use 1.6 or later 'react-scripts' is not recognized as an internal or external command How to create a Java / Maven project that works in Visual Studio Code? "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository Java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException

Examples related to module

How to fix: fatal error: openssl/opensslv.h: No such file or directory in RedHat 7 How to import functions from different js file in a Vue+webpack+vue-loader project Typescript ReferenceError: exports is not defined ImportError: No module named tensorflow ModuleNotFoundError: What does it mean __main__ is not a package? ES6 modules in the browser: Uncaught SyntaxError: Unexpected token import module.exports vs. export default in Node.js and ES6 What's the difference between an Angular component and module Export multiple classes in ES6 modules Python - Module Not Found

Examples related to build-automation

What is Gradle in Android Studio? Maven: Non-resolvable parent POM Controlling Maven final name of jar artifact How do I clear my Jenkins/Hudson build history? How can I get CMake to find my alternative Boost installation? Ant: How to execute a command for each file in directory? Xcode variables Why does Maven have such a bad rep? How can I create an executable JAR with dependencies using Maven? Ant task to run an Ant target only if a file exists?

Examples related to parent-child

The specified child already has a parent. You must call removeView() on the child's parent first (Android) Example of waitpid() in use? get parent's view from a layout CSS :: child set to change color on parent hover, but changes also when hovered itself How to pass data from 2nd activity to 1st activity when pressed back? - android Make absolute positioned div expand parent div height JavaScript DOM: Find Element Index In Container How to set opacity in parent div and not affect in child div? How to select <td> of the <table> with javascript? Maven: Non-resolvable parent POM