Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Invalid
-
None
-
None
-
None
-
maven 3.0.3
Description
I have three two simple projects:
<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">
<parent>
<groupId>prova</groupId>
<artifactId>Mioframework</artifactId>
<version>0.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>my-mioprogetto</artifactId>
<name>Mio progetto</name>
<dependencies>
<!-- Internal dependencies -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>my-mioprogetto2</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
<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">
<parent>
<groupId>prova</groupId>
<artifactId>Mioframework</artifactId>
<version>0.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>my-mioprogetto2</artifactId>
<name>Mio progetto 2</name>
</project>
and one parent project:
<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>
<groupId>prova</groupId>
<artifactId>Mioframework</artifactId>
<version>0.4.0-SNAPSHOT</version>
<name>Mioframework</name>
<packaging>pom</packaging>
<modules>
<module>mioprogetto</module>
<module>mioprogetto2</module>
</modules>
</project>
mioprogetto as mioprogetto2 as dependency. Mioframework has the two projects as modules.
If I compile mioframework I have no problems.
If I compile only mioprogetto2 I have no problems.
If I compile only mioprogetto I have problems because the dependency is not matched. Here the error:
[ERROR] Failed to execute goal on project my-mioprogetto: Could not resolve dependencies for project prova:my-mioprogetto:jar:0.4.0-SNAPSHOT: Could not find artifact prova:my-mioprogetto2:jar:0.4.0-SNAPSHOT in myrepo-xxxxxxx (http://repository.xxxxxxxxx) -> [Help 1]
I attach the complete example test