Description
When an dependency has POM file that contains reference to the parent like shown below. The parser is mistakenly retrieve the artifictId for the parent. This cause Ivy to fail.
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<parent>
<artifactId>acegi-security-parent</artifactId>
<groupId>org.acegisecurity</groupId>
<version>1.0.0-RC1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>acegi-security</artifactId>
<name>Acegi Security System for Spring</name>
<version>1.0.0-RC1</version>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-remoting</artifactId>
<version>1.2.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>1.2.6</version>
</dependency>
.....
</dependencies>
</project>
Here is a patch to address this problem:
Index: /home/bstby/workspace/ivy/src/java/fr/jayasoft/ivy/external/m2/PomModuleDescriptorParser.java
===================================================================
— /home/bstby/workspace/ivy/src/java/fr/jayasoft/ivy/external/m2/PomModuleDescriptorParser.java (revision 265)
+++ /home/bstby/workspace/ivy/src/java/fr/jayasoft/ivy/external/m2/PomModuleDescriptorParser.java (working copy)
@@ -176,7 +176,8 @@
if (_organisation == null && context.endsWith("groupId"))
else if (_module == null && context.endsWith("artifactId"))
{ - _module = txt; + if (!context.equals("project/parent/artifactId")) + _module = txt; }else if (_revision == null && context.endsWith("version"))
{ _revision = txt; }else if (_scope == null && context.endsWith("scope")) {