You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by ma...@apache.org on 2007/01/16 22:55:45 UTC

svn commit: r496885 - in /incubator/ivy/trunk: ./ src/java/org/apache/ivy/external/m2/ test/java/org/apache/ivy/external/m2/

Author: maartenc
Date: Tue Jan 16 14:55:44 2007
New Revision: 496885

URL: http://svn.apache.org/viewvc?view=rev&rev=496885
Log:
PomModuleDescriptorParser fails with nested profile dependency (IVY-392)

Added:
    incubator/ivy/trunk/test/java/org/apache/ivy/external/m2/test-dependencies-with-profile.pom
Modified:
    incubator/ivy/trunk/CHANGES.txt
    incubator/ivy/trunk/src/java/org/apache/ivy/external/m2/PomModuleDescriptorParser.java
    incubator/ivy/trunk/test/java/org/apache/ivy/external/m2/PomModuleDescriptorParserTest.java

Modified: incubator/ivy/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ivy/trunk/CHANGES.txt?view=diff&rev=496885&r1=496884&r2=496885
==============================================================================
--- incubator/ivy/trunk/CHANGES.txt (original)
+++ incubator/ivy/trunk/CHANGES.txt Tue Jan 16 14:55:44 2007
@@ -16,6 +16,8 @@
 - FIX: Comments in ivy.xml duplicated (IVY-336) (thanks to Gilles Scokart)
 - FIX: Ivy failure when the ivy.xml file contains non US-ASCII characters (IVY-346) (thanks to Gilles Scokart)
 - FIX: Urlresolver is not possible to use dynamic revisions on nonstandard repository structure (IVY-350) (thanks to Pierre Hägnestrand)
+- FIX: PomModuleDescriptorParser fails with nested profile dependency (IVY-392) (thanks to William Lyvers)
+
 
    version 1.4.1 - 2006-11-09
 =====================================

Modified: incubator/ivy/trunk/src/java/org/apache/ivy/external/m2/PomModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/incubator/ivy/trunk/src/java/org/apache/ivy/external/m2/PomModuleDescriptorParser.java?view=diff&rev=496885&r1=496884&r2=496885
==============================================================================
--- incubator/ivy/trunk/src/java/org/apache/ivy/external/m2/PomModuleDescriptorParser.java (original)
+++ incubator/ivy/trunk/src/java/org/apache/ivy/external/m2/PomModuleDescriptorParser.java Tue Jan 16 14:55:44 2007
@@ -172,7 +172,7 @@
                 _organisation = null;
                 _module = null;
             }
-            if ("dependency".equals(qName)) {
+            if ("project/dependencies/dependency".equals(getContext())) {
                 _organisation = null;
                 _module = null;
                 _revision = null;

Modified: incubator/ivy/trunk/test/java/org/apache/ivy/external/m2/PomModuleDescriptorParserTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/trunk/test/java/org/apache/ivy/external/m2/PomModuleDescriptorParserTest.java?view=diff&rev=496885&r1=496884&r2=496885
==============================================================================
--- incubator/ivy/trunk/test/java/org/apache/ivy/external/m2/PomModuleDescriptorParserTest.java (original)
+++ incubator/ivy/trunk/test/java/org/apache/ivy/external/m2/PomModuleDescriptorParserTest.java Tue Jan 16 14:55:44 2007
@@ -103,6 +103,19 @@
         assertEquals(ModuleRevisionId.newInstance("commons-logging", "commons-logging", "1.0.4"), dds[0].getDependencyRevisionId());
     }
     
+    // IVY-392
+    public void testDependenciesWithProfile() throws Exception {
+        ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(new Ivy(), getClass().getResource("test-dependencies-with-profile.pom"), false);
+        assertNotNull(md);
+        
+        assertEquals(ModuleRevisionId.newInstance("org.apache", "test", "1.0"), md.getModuleRevisionId());
+        
+        DependencyDescriptor[] dds = md.getDependencies();
+        assertNotNull(dds);
+        assertEquals(1, dds.length);
+        assertEquals(ModuleRevisionId.newInstance("commons-logging", "commons-logging", "1.0.4"), dds[0].getDependencyRevisionId());
+    }
+    
     public void testWithoutVersion() throws Exception {
         ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(new Ivy(), getClass().getResource("test-without-version.pom"), false);
         assertNotNull(md);

Added: incubator/ivy/trunk/test/java/org/apache/ivy/external/m2/test-dependencies-with-profile.pom
URL: http://svn.apache.org/viewvc/incubator/ivy/trunk/test/java/org/apache/ivy/external/m2/test-dependencies-with-profile.pom?view=auto&rev=496885
==============================================================================
--- incubator/ivy/trunk/test/java/org/apache/ivy/external/m2/test-dependencies-with-profile.pom (added)
+++ incubator/ivy/trunk/test/java/org/apache/ivy/external/m2/test-dependencies-with-profile.pom Tue Jan 16 14:55:44 2007
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache</groupId>
+  <artifactId>test</artifactId>
+  <name>Test Module for Ivy M2 parsing</name>
+  <version>1.0</version>
+  <url>http://ivy.jayasoft.org/</url>
+  <organization>
+    <name>Jayasoft</name>
+    <url>http://www.jayasoft.org/</url>
+  </organization>
+  <profiles>
+    <profile>
+      <id>j4</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>retrotranslator-maven-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>retrotranslate</id>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <artifactId>maven-jar-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>create-j4-jar</id>
+                <goals>
+                  <goal>jar</goal>
+                </goals>
+                <configuration>
+                  <classesDirectory>${project.build.directory}/classes-retro</classesDirectory>
+                  <classifier>j4</classifier>
+                  <archive>
+                    <manifestEntries>
+                      <Extension-Name>${project.artifactId}-j4</Extension-Name>
+                      <Specification-Vendor>${project.organization.name}</Specification-Vendor>
+                      <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
+                      <Implementation-Title>${project.description}</Implementation-Title>
+                      <Implementation-Version>2.0.2-SNAPSHOT</Implementation-Version>
+                      <Revision>${scm.revision}</Revision>
+                    </manifestEntries>
+                  </archive>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+      <dependencies>
+        <dependency>
+          <groupId>net.sf.retrotranslator</groupId>
+          <artifactId>retrotranslator-runtime</artifactId>
+          <version>1.0.8</version>
+        </dependency>
+      </dependencies>
+    </profile>
+  </profiles>
+  <dependencies>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.0.4</version>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file