I can't seem to get Maven to find a sibling's module in a multi-module project.
I've run mvn clean install
in all modules.
Here's the setup:
Product
+-- MagniCompCommon
+-- Model
The Model
project has MagniCompCommon
as a dependency. When I run mvn clean compile
in Model
, I get:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Model 1.0
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.magnicomp:MagniCompCommon:jar:1.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.585 s
[INFO] Finished at: 2015-10-14T10:09:04-07:00
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Model: Could not resolve dependencies for project com.magnicomp:Model:jar:1.0: Failure to find com.magnicomp:MagniCompCommon:jar:1.0 in http://download.java.net/maven/2/ was cached in the local repository, resolution will not be reattempted until the update interval of Java.Net has elapsed or updates are forced -> [Help 1]
As you can see, Maven is trying to find MagniCompCommon
in the java.net repo (this is the first repository entry in the parent (Product
) pom.xml
).
Here is Product pom.xml
:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.magnicomp</groupId>
<artifactId>Product</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>MagniCompCommon</module>
<module>Model</module>
<module>Common</module>
<module>Agent</module>
<module>Doc</module>
</modules>
... snip ...
<repositories>
<repository>
<id>Java.Net</id>
<url>http://download.java.net/maven/2/</url>
</repository>
Here is MagniCompCommon pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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>
<parent>
<groupId>com.magnicomp</groupId>
<artifactId>Product</artifactId>
<version>1.0</version>
</parent>
<!-- <groupId>com.magnicomp.common</groupId> -->
<artifactId>MagniCompCommon</artifactId>
<packaging>jar</packaging>
Here is Model pom.xml
<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>
<parent>
<groupId>com.magnicomp</groupId>
<artifactId>Product</artifactId>
<version>1.0</version>
</parent>
<artifactId>Model</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.magnicomp</groupId>
<artifactId>MagniCompCommon</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</project>