I have a Maven module with a submodule.
父母的相关部分是:
<groupId>my.package.name</groupId>
<artifactId>parent-module</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>my.package.name</name>
<modules>
<module>child-module</module>
</modules>
儿童的相关部分是:
<groupId>my.package.name</groupId>
<artifactId>child-module</artifactId>
<version>1.0-SNAPSHOT</version>
<name>my.package.name</name>
<parent>
<groupId>my.package.name</groupId>
<artifactId>parent-module</artifactId>
<version>1.0</version>
<relativePath>../pom.xml</relativePath> <!-- not necessary -->
</parent>
为此,我:
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for my.package.name:child-module:1.0-SNAPSHOT: Failure to find my.package.name:parent-module:pom:1.0 in https://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 11, column 13
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project my.package.name:child-module:1.0-SNAPSHOT (/path/to/parent-module/child-module/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for my.package.name:child-module:1.0-SNAPSHOT: Failure to find my.package.name:parent-module:pom:1.0 in https://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 11, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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
XML档案位于:
/parent-module/child-module/pom.xml
/parent-module/pom.xml
So why is it trying to find the parne module in the online Maven repository? Why doesn t see it locally?