Non-resolvable parent POM for Could not find artifact and 'parent.relativePath' points at wrong local POM

前端 未结 9 1114
广开言路
广开言路 2021-02-05 03:58

I am new to maven.

I have one project which I try to build with the maven3.

When I run the command mvn -X clean install I got the error.

<         


        
相关标签:
9条回答
  • 2021-02-05 04:05

    I encountered an issue like this using the Maven Release Plugin. Resolving using relative paths (i.e. for the parent pom in the child module ../parent/pom.xml) did not seem to work in this scenario, it keeps looking for the released parent pom in the Nexus repository. Moving the parent pom to the parent folder of the module resolved this.

    0 讨论(0)
  • 2021-02-05 04:05

    In my case, the reason was a simple typo.

    <parent>
        <groupId>org.sringframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.5.RELEASE</version>
    </parent>
    

    A missing character in the groupId org.s(p)ringframework lead to this error.

    0 讨论(0)
  • 2021-02-05 04:11

    In pom.xml file of the project,

    <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>X.X.X.RELEASE</version>
    <relativePath> ../PROJECTNAME/pom.xml</relativePath>
    </parent>
    

    Pointing relativepath to the same MAVEN project POM file solved the issue for me.

    0 讨论(0)
  • 2021-02-05 04:16

    We had the same issue.

    The parent pom file was available in our local repository, but maven still unsuccessfully tried to download it from the central repository, or from the relativePath (there were no files in the relative path).

    Turns out, there was a file called "_remote.repositories" in the local repository, which was causing this behavior. After deleting all the files with this name from the complete local repository, we could build our modules.

    0 讨论(0)
  • 2021-02-05 04:23

    You need to have the file /root/test/devenv/openstack-rhel/pom.xml

    This file need to have the followings elements:

    <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">
        <modelVersion>4.0.0</modelVersion>
        <groupId>org.openstack</groupId>
        <artifactId>openstack-rhel-rpms</artifactId>
        <version>2012.1-SNAPSHOT</version>
        <packaging>pom</packaging>
    </project>
    
    0 讨论(0)
  • 2021-02-05 04:24

    Give the relative path URL value to the pom.xml file
    ../parentfoldername/pom.xml

    0 讨论(0)
提交回复
热议问题