Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.0.4
-
None
-
None
-
AIX (Java build 1.4.2, J2RE 1.4.2 IBM AIX) , Windows XP ( Java SUN 1.4.2_10-b03)
Maven 2.0.4
Description
Given the following directory layout
/a - pom.xml
/b - pom.xml
- /b.a -pom.xml
The poms - a/pom.xml:
-------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.foo</groupId>
<artifactId>a</artifactId>
<version>I</version>
<name>Module A</name>
<packaging>pom</packaging>
<modules>
<module>b</module>
</modules>
</project>
The poms - a/b/pom.xml:
-------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<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/maven-v4_0_0.xsd">
<parent>
<groupId>com.foo</groupId>
<artifactId>a</artifactId>
<version>I</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.foo</groupId>
<artifactId>b</artifactId>
<version>I</version>
<name>Module B</name>
<packaging>pom</packaging>
<modules>
<module>b.a</module>
</modules>
</project>
The poms - a/b/b.a/pom.xml:
-------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<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/maven-v4_0_0.xsd">
<parent>
<groupId>com.foo</groupId>
<artifactId>b</artifactId>
<version>I</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.foo</groupId>
<artifactId>b.a</artifactId>
<version>I</version>
<name>Module B.A</name>
<packaging>jar</packaging>
</project>
The error occurs only in direcotry a/b (the build in dir a and in dir a/b/b.a works fine):
$> cd ~/a/b
$> mvn compile
[INFO] Scanning for projects...
Downloading: http://.../repository/com/foo/a/I/a-I.pom
[WARNING] Unable to get resource from repository central
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
GroupId: com.foo
ArtifactId: a
Version: I
It seems that there is a problem with more than one parent with packaging=pom.
The <relativePath>--Element didn't help. The only workearound (suggested in the maven user mailing list) is, to deploy the parent
poms to the maven repo.