ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r750671 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/core/module/descriptor/ test/java/org/apache/ivy/core/resolve/ test/repositories/m2/org/apache/test-classified/2.0/ test/repositories/m2/org/apache/test-classifier/2.0/
Date Thu, 05 Mar 2009 23:17:41 GMT
Author: maartenc
Date: Thu Mar  5 23:17:41 2009
New Revision: 750671

URL: http://svn.apache.org/viewvc?rev=750671&view=rev
Log:
FIX: Ivy doesn't handle the classifier attribute of artifacts inside dependency elements (IVY-1041)

Added:
    ant/ivy/core/trunk/test/repositories/m2/org/apache/test-classified/2.0/
    ant/ivy/core/trunk/test/repositories/m2/org/apache/test-classified/2.0/test-classified-2.0-asl.jar
  (with props)
    ant/ivy/core/trunk/test/repositories/m2/org/apache/test-classifier/2.0/
    ant/ivy/core/trunk/test/repositories/m2/org/apache/test-classifier/2.0/test-classifier-2.0.pom
Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=750671&r1=750670&r2=750671&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Thu Mar  5 23:17:41 2009
@@ -99,6 +99,7 @@
 - IMPROVEMENT: Error message is not clear when specifying an invalid value for checksums
(IVY-977)
 - IMPROVEMENT: catch AccessControlException on System.getProperties() (IVY-1015)
 
+- FIX: Ivy doesn't handle the classifier attribute of artifacts inside dependency elements
(IVY-1041)
 - FIX: Buildnumber task does not work for chained resolvers (IVY-1037)
 - FIX: Dependencies don't inherit exclusions from dependencyManagement (IVY-974) (thanks
to John Gibson)
 - FIX: Dependency Configuration Negation does not work (IVY-982)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java?rev=750671&r1=750670&r2=750671&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java
Thu Mar  5 23:17:41 2009
@@ -105,7 +105,7 @@
             for (int i = 0; i < artifacts.length; i++) {
                 moduleDescriptor.addArtifact(DEFAULT_CONFIGURATION, new MDArtifact(
                         moduleDescriptor, artifacts[i].getName(), artifacts[i].getType(),
-                        artifacts[i].getExt(), artifacts[i].getUrl(), null));
+                        artifacts[i].getExt(), artifacts[i].getUrl(), artifacts[i].getExtraAttributes()));
             }
         } else {
             moduleDescriptor.addArtifact(DEFAULT_CONFIGURATION, new MDArtifact(moduleDescriptor,

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java?rev=750671&r1=750670&r2=750671&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java Thu Mar  5 23:17:41
2009
@@ -3830,7 +3830,6 @@
         }
     }
 
-    
     public void testResolveMaven2Classifiers() throws Exception {
         // test case for IVY-418
         // test-classifier depends on test-classified with classifier asl
@@ -3858,6 +3857,33 @@
                     , "1.0", "test-classified", "jar", "jar", cmap).exists());
     }
 
+    public void testResolveMaven2ClassifiersWithoutPOM() throws Exception {
+        // test case for IVY-1041
+        // test-classifier depends on test-classified with classifier asl
+        Ivy ivy = new Ivy();
+        ivy.configure(new File("test/repositories/m2/ivysettings.xml").toURL());
+        ResolveReport report = ivy.resolve(new File(
+                "test/repositories/m2/org/apache/test-classifier/2.0/test-classifier-2.0.pom")
+                .toURL(), getResolveOptions(new String[] {"*"}));
+        assertNotNull(report);
+        ModuleDescriptor md = report.getModuleDescriptor();
+        assertNotNull(md);
+        ModuleRevisionId mrid = ModuleRevisionId
+                .newInstance("org.apache", "test-classifier", "2.0");
+        assertEquals(mrid, md.getModuleRevisionId());
+
+        assertTrue(getResolvedIvyFileInCache(mrid).exists());
+
+        // dependencies
+        assertTrue(getIvyFileInCache(
+            ModuleRevisionId.newInstance("org.apache", "test-classified", "2.0")).exists());
+        
+        Map cmap = new HashMap();
+        cmap.put("classifier", "asl");
+        assertTrue(getArchiveFileInCache(ivy, "org.apache", "test-classified", null /* branch
*/
+                    , "2.0", "test-classified", "jar", "jar", cmap).exists());
+    }
+
     public void testResolveMaven2GetSources() throws Exception {
         Ivy ivy = new Ivy();
         ivy.configure(new File("test/repositories/m2/ivysettings.xml").toURL());

Added: ant/ivy/core/trunk/test/repositories/m2/org/apache/test-classified/2.0/test-classified-2.0-asl.jar
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/m2/org/apache/test-classified/2.0/test-classified-2.0-asl.jar?rev=750671&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/m2/org/apache/test-classified/2.0/test-classified-2.0-asl.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ant/ivy/core/trunk/test/repositories/m2/org/apache/test-classifier/2.0/test-classifier-2.0.pom
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/m2/org/apache/test-classifier/2.0/test-classifier-2.0.pom?rev=750671&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/m2/org/apache/test-classifier/2.0/test-classifier-2.0.pom
(added)
+++ ant/ivy/core/trunk/test/repositories/m2/org/apache/test-classifier/2.0/test-classifier-2.0.pom
Thu Mar  5 23:17:41 2009
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache</groupId>
+  <artifactId>test-classifier</artifactId>
+  <name>Test Module for Ivy M2 parsing</name>
+  <version>2.0</version>
+  <packaging>pom</packaging>
+  <url>http://ivy.jayasoft.org/</url>
+  <organization>
+    <name>Jayasoft</name>
+    <url>http://www.jayasoft.org/</url>
+  </organization>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache</groupId>
+      <artifactId>test-classified</artifactId>
+      <version>2.0</version>
+      <classifier>asl</classifier>
+    </dependency>
+  </dependencies>
+</project>



Mime
View raw message