Project build error non resolvable parent pom for

In this tutorial, we demonstrate how to deal with Maven's non-resolvable parent POM problem by providing helpful sample code in Java and XML languages.

I recently got an email from Nosheen Javed asking about an exception he was getting on his Maven build. The exception was:

[FATAL] Non-resolvable parent POM: Failure to find com.mycompany.samples:biometrics-samples:pom:4.2.0.0

…which, when listed in full, comes out as:

Apache Maven 3.0.4 (r1232337; 2012-01-17 13:44:56+0500)
Maven home: C:UsersNosheenworkspacesimple-fingers-sampleEMBEDDED
Java version: 1.7.0_07, vendor: Oracle Corporation
Java home: C:Program Files (x86)Javajre7
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from EMBEDDEDconfsettings.xml
[DEBUG] Reading user settings from C:UsersNosheen.m2settings.xml
[DEBUG] Using local repository at C:UsersNosheen.m2repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C:UsersNosheen.m2repository
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]

org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM: Failure to find com.mycompany.samples:biometrics-samples:pom:4.2.0.0 inhttp://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 4, column 10
 at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:363)
 at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
 at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:585)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:234)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
 at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[ERROR]  
[ERROR]   The project com.mycompany.samples:simple-fingers-sample:4.2.0.0 (C:UsersNosheenworkspacesimple-fingers-samplepom.xml) has 1 error
[ERROR]     Non-resolvable parent POM: Failure to find com.mycompany.samples:biometrics-samples:pom:4.2.0.0 inhttp://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 4, column 10 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Failure to find com.mycompany.samples:biometrics-samples:pom:4.2.0.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
 at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:159)
 at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:813)
 at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:664)
 at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:310)
 at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:232)
 at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:410)
 at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:379)
 at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:343)
 at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
 at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:585)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:234)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
 at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Failure to find com.mycompany.samples:biometrics-samples:pom:4.2.0.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
 at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
 at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
 at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
 at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:286)
 at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:155)
 ... 22 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to find com.mycompany.samples:biometrics-samples:pom:4.2.0.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
 at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:230)
 at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:204)
 at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:427)
 ... 26 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

I thought it worth noting as it’s something I’ve seen several times. It generally crops up when you’re setting up a project giving you a bewildering amount of information. This is telling me that slf4j has not been set up, that the build is using Java version 1.7.0_07 from Oracle, and that the Maven home is C:UsersNosheenworkspacesimple-fingers-sampleEMBEDDED; however, if you dissect the whole lot, you can refine the problem down to the following:

[FATAL] Non-resolvable parent POM: Failure to find com.mycompany.samples:biometrics-samples:pom:4.2.0.0 inhttp://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM

This means that the project the Nosheen is trying to get to compile has a parent project called «com.mycompany.samples:biometrics-samples:pom» and Maven can’t find it.In this case, I’m assuming that the parent project «com.mycompany.samples:biometrics-samples:pom» is a MyCompany internal project that will not be stored in an external Maven repository like Maven Central.The irritating thing about this exception is that there are a few reasons for it to be thrown which means that there are a number of things that you have to check in order to fix it.Firstly, is the parent project in your local repository? If not there are a couple of options, like do you need to check it out and build it yourself? If you have checked it out can your project see it or do you need to add a relative path element to your project’s POM file? Something like this:

<parent>
  <groupId>com.mycompany.samples</groupId>
  <artifactId>biometrics-samples</artifactId>
  <version>1.0-SNAPSHOT</version>
  <relativePath>{path to}/mycompany-samples/pom.xml</relativePath>
 </parent>

If your company has an internal repository on some company server somewhere, then do you need to add a reference to it in either of your local or global settings.xml or pom.xml files? Something like this JBoss public repository definition:

<repositories>
  <repository> 
      <id>jboss-public-repository-group</id> 
      <url>https://repository.jboss.org/nexus/content/groups/public-jboss</url> 
   <releases> 
    <enabled>true</enabled> 
   </releases> 
   <snapshots> 
     <enabled>true</enabled> 
   </snapshots> 
  </repository>
 </repositories>

If your Maven build is being accessed via Eclipse, then are your Eclipse preferences set up correctly? You may have installed a separate copy/version of Maven to the internal one supplied by Eclipse; are you using that by mistake? Check this here in your preferences:

Using the wrong one may mean that you’re using the wrong version of the global settings.xml.The fortunate thing is that you can confirm that your Eclipse settings are okay by taking a look at the exception message above. At the top of the message you’ll see:

DEBUG] Reading global settings from EMBEDDEDconfsettings.xml
[DEBUG] Reading user settings from C:UsersNosheen.m2settings.xml
[DEBUG] Using local repository at C:UsersNosheen.m2repository

From this, you can see that Nosheen is using the embedded Eclipse instance, taking the global settings.xml from EMBEDDEDconfsettings.xml and the user settings.xml from C:UsersNosheen.m2settings.xml. The local repository is at C:UsersNosheen.m2repository.If you still have problems, then check out the advice given in the links at the bottom of the exception:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Finally, there are the obvious things to check, like, have you spelled the name of the parent project correctly?

Apache Maven
Eclipse
Repository (version control)
Build (game engine)
JBoss
Advice (programming)
IT
Java (programming language)

Issue

I’m trying to make a child project into a parent project (This child project really doesn’t depend on parent so I’m trying to make this a parent project so I can merge it with another project during jenkins file).

I changed the parent section of the POM file

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

But when I build I get the following error in jenkins.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[[1;34mINFO[m] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/spring-boot-starter-parent/org.springframework.boot/1.2.5%20RELEASE/org.springframework.boot-1.2.5%20RELEASE.pom
[[1;31mERROR[m] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for demo-api:demo-api:1.0-SNAPSHOT: Could not find artifact spring-boot-starter-parent:org.springframework.boot:pom:1.2.5 RELEASE in central (https://repo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM @ line 5, column 13
 @ 
[[1;31mERROR[m] The build could not read 1 project -> [1m[Help 1][m
[[1;31mERROR[m]   
[[1;31mERROR[m]   The project demo-api:demo-api:1.0-SNAPSHOT (/home/estt/jenkins/workspace/demo-api-2/pom.xml) has 1 error
[[1;31mERROR[m]     Non-resolvable parent POM for demo-api:demo-api:1.0-SNAPSHOT: Could not find artifact spring-boot-starter-parent:org.springframework.boot:pom:1.2.5 RELEASE in central (https://repo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM @ line 5, column 13 -> [1m[Help 2][m
[[1;31mERROR[m] 
[[1;31mERROR[m] To see the full stack trace of the errors, re-run Maven with the [1m-e[m switch.
[[1;31mERROR[m] Re-run Maven using the [1m-X[m switch to enable full debug logging.
[[1;31mERROR[m] 

Here is the complete pom.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
       <artifactId>org.springframework.boot</artifactId>
        <groupId>spring-boot-starter-parent</groupId>
        <version>1.2.5.RELEASE</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <packaging>jar</packaging>

    <artifactId>demo-api</artifactId>
    <groupId>demo-api</groupId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>2.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>2.3.3</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <version>3.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <mainClass>com.apiDemo.ApiApplication</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Solution

Your groupId and artifactId in the parent, are reversed:

Should be:

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

Instead of

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

Answered By — JRichardsz

This issue appears when we try to execute the mvn clean install command to build out the project and tries to copy the resources into a local repo directory.

The issue looks like this:

.....
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[WARNING] 'parent.relativePath' points at org.felipe:tutorial_maven instead of ${parent.groupId}:tutorial_maven, please verify your project structure @ line 3, column 13
[FATAL] Non-resolvable parent POM: Could not transfer artifact ${parent.groupId}:tutorial_maven:pom:${parent.version} from/to central (http://repo.maven.apache.org/maven2): Illegal character in path at index 37: http://repo.maven.apache.org/maven2/${parent/groupId}/tutorial_maven/${parent.version}/tutorial_maven-${parent.version}.pom and 'parent.relativePath' points at wrong local POM @ line 3, column 13

at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:363)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:585)...

But your system is not allowed or not able to access the resources due to some proxy configuration settings. maybe your not pointing to the correct VPN settings.

Solution: Update Maven Settings.xml

To allow access you need to update the settings.xml file with the following proxy details:

<proxies>
    <proxy>
      <id>myproxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>user</username>  <!-- Put your username here -->
      <password>pass</password>  <!-- Put your password here -->
      <host>123.45.6.78</host>   <!-- Put the IP address of your proxy server here -->
      <port>80</port>            <!-- Put your proxy server's port number here -->
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts> <!-- Do not use this setting unless you know what you're doing. -->
    </proxy>    
  </proxies>

Most probably the issue comes out to be the location of the VPN connection when a user is behind a proxy network.

Ezoic

Понравилась статья? Поделить с друзьями:
  • Progressnotificationcommon dll citrix ошибка при установки
  • Programming new key error
  • Programming error 0x08000000
  • Programmer device is unavailable or error minipro
  • Programat p300 ошибка 701