It is something likes Maven: Non-resolvable parent POM but not the same.
I have a parent pom
<groupId>group</groupId>
<artifactId>parent</artifactId>
<version>SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>module1</module>
<module>module2</module>
<module>module3</module>
</modules>
module1
defines some dependencies
using dependencyManagement
child pom: module3/pom.xml
trying to import module1
<parent>
<artifactId>group</artifactId>
<groupId>parent</groupId>
<version>SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>group</groupId>
<artifactId>module1</artifactId>
<version>SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
<!--
<systemPath>../module1</systemPath>
-->
</dependency>
</dependencies>
</dependencyManagement>
If I try to build the parent, it is OK
mvn validate
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
... ...
[INFO] parent ............................................ SUCCESS [0.128s]
[INFO] module1 ........................................... SUCCESS [0.011s]
[INFO] module2 ........................................... SUCCESS [0.009s]
[INFO] module3 ........................................... SUCCESS [0.009s]
... ...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
But if I run the build in child module, it fails
mvn validate
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project group:module3:SNAPSHOT (/path-tp/project/module3/pom.xml) has 5 errors
[ERROR] Non-resolvable import POM: Failure to find group:module1:pom:SNAPSHOT in https://repo1.maven.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced @ line 22, column 19 -> [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
What I'd tried
- I'd try using
systemPath
but it is not supported forimport
scope. - I'd try move the
import
scopedependencies
declaration frommodule3
to parent-module, but it failed complaining circular-dependency
How can I build/load the lone sub-module module3
, or is there any other way to split tons of dependencyManagement
s to multi sub-module?