Maven: Non-resolvable parent POM

后端 未结 14 1524
一整个雨季
一整个雨季 2020-12-02 11:04

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 b         


        
相关标签:
14条回答
  • 2020-12-02 11:23

    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 ..

    0 讨论(0)
  • 2020-12-02 11:25

    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>
    
    0 讨论(0)
  • 2020-12-02 11:27

    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.

    0 讨论(0)
  • 2020-12-02 11:27

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

    0 讨论(0)
  • 2020-12-02 11:37

    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.

    0 讨论(0)
  • 2020-12-02 11:38

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

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