Non-resolvable parent POM using Maven 3.0.3 and relativePath notation

后端 未结 8 2192
既然无缘
既然无缘 2021-02-03 21:19

After migrating to Mavent 3.0.3 Parent poms in several Projects cannot be resolved anymore.

The Projects are structured in a default manner, so I set parent.relativePath

相关标签:
8条回答
  • 2021-02-03 21:55

    Make sure you Double-Check that the version you refer to in the child-pom is the same as that in the parent-pom. For me, I'd bumped version in the parent and had it as 3.1.0.0-RELEASE, but in the child-pom, I was still referring to the previous version via relativePath, and had it defined as 2.0.0.0-SNAPSHOT. It did not make any difference if I included just the parent directory, or had the "pom.xml" appended to the directory:

        <parent>        
        <artifactId>eric-project-parent</artifactId>
        <groupId>com.eric.common</groupId>
         <!-- Should be 3.1.0.0-RELEASE -->
        <version>2.0.0.0-SNAPSHOT</version>     
        <relativePath>
                    ../../EricParentAsset/projects/eric-project-parent</relativePath>           
    </parent>
    
    0 讨论(0)
  • 2021-02-03 21:57
    <parent>
            <groupId>com.test.vaquar.khan</groupId>
            <artifactId>vk-parent</artifactId>
            <version>1.0.0-SNAPSHOT</version>
            <relativePath>../projectname/pom.xml</relativePath>
        </parent>
    

    Add following line in parent

    <relativePath>../projectname/pom.xml</relativePath>
    

    You need relative path if you are building from local parent pom not available in nexsus, add pom in nexus then no need this path

    0 讨论(0)
  • 2021-02-03 22:02

    Here is answer to your question.

    By default maven looks in ../pom.xml for relativePath. Use empty <relativePath/> tag instead.

    0 讨论(0)
  • 2021-02-03 22:02

    For me, it works when I double checked the parent´s "group ID" and "artifact ID" that in my case were the wrong ones and that was the problem.

    0 讨论(0)
  • 2021-02-03 22:05

    Please check in logs if you have http.HttpWagon$__sisu1:Cannot find 'basicAuthScope' this error or warning also, if so you need to use maven 3.2.5 version, which will resolve error.

    0 讨论(0)
  • 2021-02-03 22:07

    'parent.relativePath' points at wrong local POM @ myGroup:myParentArtifactId:1.0, C:\myProjectDir\parent\pom.xml

    This indicates that maven did search locally for the parent pom, but found that it was not the correct pom.

    • Does pom.xml of parentpom correctly define the parent pom as the pom.xml of rootpom?
    • Does rootpom folder contain pom.xml as well as the paretpom folder?
    0 讨论(0)
提交回复
热议问题