ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r1419772 - in /ant/ivy/core/branches/2.3.x: ./ src/java/org/apache/ivy/plugins/parser/m2/ test/java/org/apache/ivy/core/resolve/ test/repositories/parentPom/org/apache/dm/parent/2.0/ test/repositories/parentPom/org/apache/dm/parent2/1.0/ te...
Date Mon, 10 Dec 2012 21:13:44 GMT
Author: maartenc
Date: Mon Dec 10 21:13:43 2012
New Revision: 1419772

URL: http://svn.apache.org/viewvc?rev=1419772&view=rev
Log:
FIX: Maven2: resolve failure when parent has <dependencyManagement> with dependency
in 'import' scope (IVY-1376) (merged from trunk)

Added:
    ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/parent3/
      - copied from r1419758, ant/ivy/core/trunk/test/repositories/parentPom/org/apache/dm/parent3/
    ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/parent3/1.0/
      - copied from r1419758, ant/ivy/core/trunk/test/repositories/parentPom/org/apache/dm/parent3/1.0/
    ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/parent3/1.0/parent3-1.0.pom
      - copied unchanged from r1419758, ant/ivy/core/trunk/test/repositories/parentPom/org/apache/dm/parent3/1.0/parent3-1.0.pom
    ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/test/3.0/
      - copied from r1419758, ant/ivy/core/trunk/test/repositories/parentPom/org/apache/dm/test/3.0/
    ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/test/3.0/test-3.0.pom
      - copied unchanged from r1419758, ant/ivy/core/trunk/test/repositories/parentPom/org/apache/dm/test/3.0/test-3.0.pom
    ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/test5/
      - copied from r1419758, ant/ivy/core/trunk/test/repositories/parentPom/org/apache/dm/test5/
    ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/test5/1.0/
      - copied from r1419758, ant/ivy/core/trunk/test/repositories/parentPom/org/apache/dm/test5/1.0/
    ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/test5/1.0/test5-1.0.jar
      - copied unchanged from r1419758, ant/ivy/core/trunk/test/repositories/parentPom/org/apache/dm/test5/1.0/test5-1.0.jar
    ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/test5/1.0/test5-1.0.pom
      - copied unchanged from r1419758, ant/ivy/core/trunk/test/repositories/parentPom/org/apache/dm/test5/1.0/test5-1.0.pom
    ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/test5/2.0/
      - copied from r1419758, ant/ivy/core/trunk/test/repositories/parentPom/org/apache/dm/test5/2.0/
    ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/test5/2.0/test5-2.0.jar
      - copied unchanged from r1419758, ant/ivy/core/trunk/test/repositories/parentPom/org/apache/dm/test5/2.0/test5-2.0.jar
    ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/test5/2.0/test5-2.0.pom
      - copied unchanged from r1419758, ant/ivy/core/trunk/test/repositories/parentPom/org/apache/dm/test5/2.0/test5-2.0.pom
Modified:
    ant/ivy/core/branches/2.3.x/   (props changed)
    ant/ivy/core/branches/2.3.x/CHANGES.txt
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
    ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/core/resolve/ResolveTest.java
    ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/parent/2.0/parent-2.0.pom
    ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/parent2/1.0/parent2-1.0.pom

Propchange: ant/ivy/core/branches/2.3.x/
------------------------------------------------------------------------------
  Merged /ant/ivy/core/trunk:r1419758

Modified: ant/ivy/core/branches/2.3.x/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/CHANGES.txt?rev=1419772&r1=1419771&r2=1419772&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/CHANGES.txt (original)
+++ ant/ivy/core/branches/2.3.x/CHANGES.txt Mon Dec 10 21:13:43 2012
@@ -128,6 +128,10 @@ for detailed view of each issue, please 
 	Sven Zethelius
 	Aleksey Zhukov
 	
+   2.3.x
+=====================================
+- FIX: Maven2: resolve failure when parent has <dependencyManagement> with dependency
in 'import' scope (IVY-1376)
+
    2.3.0-rc2
 =====================================
 - DOCUMENTATION: Documentation and Implementation mismatch of makepom (IVY-1383) (thanks
to Thomas Kurpick)

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?rev=1419772&r1=1419771&r2=1419772&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
(original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
Mon Dec 10 21:13:43 2012
@@ -252,7 +252,13 @@ public final class PomModuleDescriptorPa
                             // add dependency management info from imported module
                             List depMgt = PomModuleDescriptorBuilder.getDependencyManagements(importDescr);
                             for (Iterator it2 = depMgt.iterator(); it2.hasNext();) {
-                                mdBuilder.addDependencyMgt((PomDependencyMgt) it2.next());
+                                PomDependencyMgt importedDepMgt = (PomDependencyMgt) it2.next();
+                                mdBuilder.addDependencyMgt(new DefaultPomDependencyMgt(
+                                        importedDepMgt.getGroupId(),
+                                        importedDepMgt.getArtifactId(),
+                                        importedDepMgt.getVersion(),
+                                        importedDepMgt.getScope(), 
+                                        importedDepMgt.getExcludedModules()));
                             }
                         } else {
                             throw new IOException("Impossible to import module for " + res.getName()
+ "."

Modified: ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/core/resolve/ResolveTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/core/resolve/ResolveTest.java?rev=1419772&r1=1419771&r2=1419772&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/core/resolve/ResolveTest.java (original)
+++ ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/core/resolve/ResolveTest.java Mon
Dec 10 21:13:43 2012
@@ -4583,6 +4583,33 @@ public class ResolveTest extends TestCas
             "test4", "jar", "jar").exists());
     }
     
+    public void testResolveMaven2ParentPomDependencyManagementWithImport() throws Exception
{
+        // IVY-1376
+        Ivy ivy = new Ivy();
+        ivy.configure(new File("test/repositories/parentPom/ivysettings.xml"));
+        ivy.getSettings().setDefaultResolver("parentChain");
+        
+        ResolveReport report = ivy.resolve(new File(
+                "test/repositories/parentPom/org/apache/dm/test/3.0/test-3.0.pom").toURL(),
+            getResolveOptions(new String[] {"*"}));
+        assertNotNull(report);
+
+        //test the report to make sure the right dependencies are listed
+        List dependencies = report.getDependencies();
+        assertFalse(report.hasError());
+        assertEquals(2, dependencies.size());
+        
+        IvyNode ivyNode;
+        ivyNode = (IvyNode) dependencies.get(0);
+        assertNotNull(ivyNode);
+        ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache.dm", "test5", "2.0");
+        assertEquals(mrid, ivyNode.getId());
+        assertTrue(getIvyFileInCache(
+            ModuleRevisionId.newInstance("org.apache.dm", "test5", "2.0")).exists());
+        assertTrue(getArchiveFileInCache(ivy, "org.apache.dm", "test5", "2.0",
+            "test5", "jar", "jar").exists());
+    }
+    
     public void testResolveMaven2Snapshot1() throws Exception {
         // test case for IVY-501
         // here we test maven SNAPSHOT versions handling, 

Modified: ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/parent/2.0/parent-2.0.pom
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/parent/2.0/parent-2.0.pom?rev=1419772&r1=1419771&r2=1419772&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/parent/2.0/parent-2.0.pom
(original)
+++ ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/parent/2.0/parent-2.0.pom
Mon Dec 10 21:13:43 2012
@@ -28,25 +28,27 @@
   <artifactId>parent</artifactId>
   <name>Test parsing parent POM</name>
   <version>2.0</version>
+  <properties>
+    <test4.version>1.0</test4.version>
+  </properties>
   <dependencyManagement>
     <dependencies>
-	<dependency>
-          <groupId>org.apache.dm</groupId>
-          <artifactId>test2</artifactId>
-          <version>${pom.version}</version>
-        </dependency>
-    <dependency>
-          <groupId>org.apache.dm</groupId>
-          <artifactId>test4</artifactId>
-          <version>1.0</version>
-        </dependency>
+      <dependency>
+        <groupId>org.apache.dm</groupId>
+        <artifactId>test2</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.dm</groupId>
+        <artifactId>test4</artifactId>
+        <version>${test4.version}</version>
+      </dependency>
     </dependencies>
   </dependencyManagement>
-   <dependencies>
+  <dependencies>
     <dependency>
       <groupId>org.apache.dm</groupId>
       <artifactId>test3</artifactId>
     </dependency>
   </dependencies>
-  
 </project>

Modified: ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/parent2/1.0/parent2-1.0.pom
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/parent2/1.0/parent2-1.0.pom?rev=1419772&r1=1419771&r2=1419772&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/parent2/1.0/parent2-1.0.pom
(original)
+++ ant/ivy/core/branches/2.3.x/test/repositories/parentPom/org/apache/dm/parent2/1.0/parent2-1.0.pom
Mon Dec 10 21:13:43 2012
@@ -23,6 +23,9 @@
   <artifactId>parent2</artifactId>
   <name>Test parsing parent POM</name>
   <version>1.0</version>
+  <properties>
+    <test3.version>1.0</test3.version>
+  </properties>
   <dependencyManagement>
     <dependencies>
 	  <dependency>
@@ -33,7 +36,13 @@
 	  <dependency>
         <groupId>org.apache.dm</groupId>
         <artifactId>test3</artifactId>
+        <version>${test3.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.dm</groupId>
+        <artifactId>parent3</artifactId>
         <version>1.0</version>
+        <scope>import</scope>
       </dependency>
     </dependencies>
   </dependencyManagement>



Mime
View raw message