Return-Path: Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: (qmail 62957 invoked from network); 21 Oct 2010 16:46:30 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Oct 2010 16:46:30 -0000 Received: (qmail 74013 invoked by uid 500); 21 Oct 2010 16:46:30 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 73973 invoked by uid 500); 21 Oct 2010 16:46:30 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 73966 invoked by uid 99); 21 Oct 2010 16:46:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Oct 2010 16:46:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Oct 2010 16:46:29 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 356AA2388980; Thu, 21 Oct 2010 16:45:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1026063 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/core/resolve/ test/java/org/apache/ivy/core/resolve/ test/repositories/1/multiple-same-deps/ test/repositories/1/multiple-same-deps/mod1/ test/repositories/1/multiple-same-deps/m... Date: Thu, 21 Oct 2010 16:45:32 -0000 To: notifications@ant.apache.org From: hibou@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101021164533.356AA2388980@eris.apache.org> Author: hibou Date: Thu Oct 21 16:45:31 2010 New Revision: 1026063 URL: http://svn.apache.org/viewvc?rev=1026063&view=rev Log: IVY-1240: a fix, and a unit test that doesn't test much unfortunately... Added: ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/ivys/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/ivys/ivy-1.0.xml ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/jars/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/jars/mod1-1.0.jar ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/ivys/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/ivys/ivy-1.0.xml ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/jars/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/jars/mod2-1.0.jar ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/ivys/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/ivys/ivy-1.0.xml ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/jars/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/jars/mod3-1.0.jar ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/ivys/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/ivys/ivy-1.0.xml ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/jars/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/jars/mod31-1.0.jar ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/ivys/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/ivys/ivy-1.0.xml ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/jars/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/jars/mod32-1.0.jar ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/ivys/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/ivys/ivy-1.0.xml ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/jars/ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/jars/mod33-1.0.jar Modified: ant/ivy/core/trunk/CHANGES.txt ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.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=1026063&r1=1026062&r2=1026063&view=diff ============================================================================== --- ant/ivy/core/trunk/CHANGES.txt (original) +++ ant/ivy/core/trunk/CHANGES.txt Thu Oct 21 16:45:31 2010 @@ -117,6 +117,7 @@ for detailed view of each issue, please - FIX: Cached ivy.xml is invalid if the description contains the ampersand entity (&) (IVY-1237) - FIX: Couldn't authenticate against sites having the same address as the proxy server (IVY-1234) - FIX: OutOfMemoryError when uploading large files using commons-httpclient (IVY-1197) (thanks to Torkild U. Resheim) +- FIX: Only the last dependency descriptor is taken into account on the same module (IVY-1240) 2.2.0 ===================================== Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java?rev=1026063&r1=1026062&r2=1026063&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java Thu Oct 21 16:45:31 2010 @@ -312,7 +312,7 @@ public class IvyNode implements Comparab "impossible to get dependencies when data has not been loaded"); } DependencyDescriptor[] dds = md.getDependencies(); - Collection dependencies = new LinkedHashSet(); // it's important to respect order + Map dependencies = new LinkedHashMap(); // it's important to respect order for (int i = 0; i < dds.length; i++) { DependencyDescriptor dd = data.mediate(dds[i]); String[] dependencyConfigurations = dd.getDependencyConfigurations(conf, requestedConf); @@ -328,9 +328,12 @@ public class IvyNode implements Comparab Message.verbose("excluding " + dd + " in " + conf); continue; } - IvyNode depNode = data.getNode( - requestedDependencyRevisionId); - + + IvyNode depNode = (IvyNode) dependencies.get(requestedDependencyRevisionId); + if (depNode == null) { + depNode = data.getNode(requestedDependencyRevisionId); + } + if (depNode == null) { depNode = new IvyNode(data, this, dd); } else { @@ -349,9 +352,9 @@ public class IvyNode implements Comparab depNode.usage.setRequiredConfs(this, conf, confs); depNode.addCaller(rootModuleConf, this, conf, requestedConf, dependencyConfigurations, dd); - dependencies.add(depNode); + dependencies.put(requestedDependencyRevisionId, depNode); } - return dependencies; + return dependencies.values(); } private void addDependencyDescriptor(IvyNode parent, DependencyDescriptor dd) { 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=1026063&r1=1026062&r2=1026063&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 Oct 21 16:45:31 2010 @@ -3629,6 +3629,24 @@ public class ResolveTest extends TestCas assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar").exists()); } + public void testResolveMultipleSameDependency() throws Exception { + ResolveReport report = ivy.resolve(new File("test/repositories/1/multiple-same-deps/mod1/ivys/ivy-1.0.xml").toURL(), + getResolveOptions(new String[] {"*"})); + + assertTrue(getArchiveFileInCache("multiple-same-deps", "mod31", "1.0", "mod31", "jar", "jar").exists()); + assertTrue(getArchiveFileInCache("multiple-same-deps", "mod32", "1.0", "mod32", "jar", "jar").exists()); + assertTrue(getArchiveFileInCache("multiple-same-deps", "mod33", "1.0", "mod33", "jar", "jar").exists()); + + ConfigurationResolveReport runtimeReport = report.getConfigurationReport("runtime"); + runtimeReport.getModuleRevisionIds().contains(ModuleRevisionId.parse("multiple-same-deps#mod31;1.0")); + runtimeReport.getModuleRevisionIds().contains(ModuleRevisionId.parse("multiple-same-deps#mod32;1.0")); + runtimeReport.getModuleRevisionIds().contains(ModuleRevisionId.parse("multiple-same-deps#mod33;1.0")); + ConfigurationResolveReport compileReport = report.getConfigurationReport("compile"); + runtimeReport.getModuleRevisionIds().contains(ModuleRevisionId.parse("multiple-same-deps#mod31;1.0")); + runtimeReport.getModuleRevisionIds().contains(ModuleRevisionId.parse("multiple-same-deps#mod32;1.0")); + runtimeReport.getModuleRevisionIds().contains(ModuleRevisionId.parse("multiple-same-deps#mod33;1.0")); + } + public void testResolveTransitiveExcludesSimple() throws Exception { // mod2.5 depends on mod2.3 and excludes one artifact from mod2.1 // mod2.3 depends on mod2.1 Added: ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/ivys/ivy-1.0.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/ivys/ivy-1.0.xml?rev=1026063&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/ivys/ivy-1.0.xml (added) +++ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/ivys/ivy-1.0.xml Thu Oct 21 16:45:31 2010 @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + Added: ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/jars/mod1-1.0.jar URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/jars/mod1-1.0.jar?rev=1026063&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/jars/mod1-1.0.jar (added) +++ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/jars/mod1-1.0.jar Thu Oct 21 16:45:31 2010 @@ -0,0 +1 @@ +. \ No newline at end of file Added: ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/ivys/ivy-1.0.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/ivys/ivy-1.0.xml?rev=1026063&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/ivys/ivy-1.0.xml (added) +++ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/ivys/ivy-1.0.xml Thu Oct 21 16:45:31 2010 @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + Added: ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/jars/mod2-1.0.jar URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/jars/mod2-1.0.jar?rev=1026063&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/jars/mod2-1.0.jar (added) +++ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/jars/mod2-1.0.jar Thu Oct 21 16:45:31 2010 @@ -0,0 +1 @@ +. \ No newline at end of file Added: ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/ivys/ivy-1.0.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/ivys/ivy-1.0.xml?rev=1026063&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/ivys/ivy-1.0.xml (added) +++ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/ivys/ivy-1.0.xml Thu Oct 21 16:45:31 2010 @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + Added: ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/jars/mod3-1.0.jar URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/jars/mod3-1.0.jar?rev=1026063&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/jars/mod3-1.0.jar (added) +++ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/jars/mod3-1.0.jar Thu Oct 21 16:45:31 2010 @@ -0,0 +1 @@ +. \ No newline at end of file Added: ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/ivys/ivy-1.0.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/ivys/ivy-1.0.xml?rev=1026063&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/ivys/ivy-1.0.xml (added) +++ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/ivys/ivy-1.0.xml Thu Oct 21 16:45:31 2010 @@ -0,0 +1,26 @@ + + + + + + + + + Added: ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/jars/mod31-1.0.jar URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/jars/mod31-1.0.jar?rev=1026063&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/jars/mod31-1.0.jar (added) +++ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/jars/mod31-1.0.jar Thu Oct 21 16:45:31 2010 @@ -0,0 +1 @@ +. \ No newline at end of file Added: ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/ivys/ivy-1.0.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/ivys/ivy-1.0.xml?rev=1026063&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/ivys/ivy-1.0.xml (added) +++ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/ivys/ivy-1.0.xml Thu Oct 21 16:45:31 2010 @@ -0,0 +1,26 @@ + + + + + + + + + Added: ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/jars/mod32-1.0.jar URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/jars/mod32-1.0.jar?rev=1026063&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/jars/mod32-1.0.jar (added) +++ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/jars/mod32-1.0.jar Thu Oct 21 16:45:31 2010 @@ -0,0 +1 @@ +. \ No newline at end of file Added: ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/ivys/ivy-1.0.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/ivys/ivy-1.0.xml?rev=1026063&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/ivys/ivy-1.0.xml (added) +++ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/ivys/ivy-1.0.xml Thu Oct 21 16:45:31 2010 @@ -0,0 +1,26 @@ + + + + + + + + + Added: ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/jars/mod33-1.0.jar URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/jars/mod33-1.0.jar?rev=1026063&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/jars/mod33-1.0.jar (added) +++ ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/jars/mod33-1.0.jar Thu Oct 21 16:45:31 2010 @@ -0,0 +1 @@ +. \ No newline at end of file