Uploaded image for project: 'Ivy'
  1. Ivy
  2. IVY-195

POM files that reference to the parent artifact download fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3-RC2
    • 1.3.1
    • Ant
    • None
    • Redhat Linux, JDK 1.5

    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"))

      { _organisation = txt; }

      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")) {

      Attachments

        Activity

          People

            xavier Xavier Hanin
            tleung Tat Leung
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: