Return-Path: Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: (qmail 28471 invoked from network); 5 Jan 2011 22:55:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Jan 2011 22:55:29 -0000 Received: (qmail 53687 invoked by uid 500); 5 Jan 2011 22:55:29 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 53661 invoked by uid 500); 5 Jan 2011 22:55:29 -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 53654 invoked by uid 99); 5 Jan 2011 22:55:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jan 2011 22:55:29 +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; Wed, 05 Jan 2011 22:55:28 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id ECB1123889BF; Wed, 5 Jan 2011 22:55:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1055675 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/core/resolve/ test/java/org/apache/ivy/core/resolve/ test/repositories/IVY-1236/ test/repositories/IVY-1236/myorg/ test/repositories/IVY-1236/myorg/modA/ test/repositories/IVY-12... Date: Wed, 05 Jan 2011 22:55:07 -0000 To: notifications@ant.apache.org From: maartenc@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110105225507.ECB1123889BF@eris.apache.org> Author: maartenc Date: Wed Jan 5 22:55:07 2011 New Revision: 1055675 URL: http://svn.apache.org/viewvc?rev=1055675&view=rev Log: FIX: Dynamic version resolution result can be incorrect when ivy metadata contains extra attributes (IVY-1236) Added: ant/ivy/core/trunk/test/repositories/IVY-1236/ ant/ivy/core/trunk/test/repositories/IVY-1236/ivy.xml ant/ivy/core/trunk/test/repositories/IVY-1236/ivysettings.xml ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/ ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modA/ ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modA/1.0/ ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modA/1.0/ivy.xml ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/ ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/ ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/ivy.xml ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/modB-A.jar ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/modB.jar Modified: ant/ivy/core/trunk/CHANGES.txt ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.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=1055675&r1=1055674&r2=1055675&view=diff ============================================================================== --- ant/ivy/core/trunk/CHANGES.txt (original) +++ ant/ivy/core/trunk/CHANGES.txt Wed Jan 5 22:55:07 2011 @@ -117,6 +117,7 @@ for detailed view of each issue, please - NEW: ivy:resolve and post resole task can now have inlined dependencies declaration. - NEW: Import Bushel into Ivy core (IVY-1241) +- FIX: Dynamic version resolution result can be incorrect when ivy metadata contains extra attributes (IVY-1236) - FIX: NullPointerException in FileUtil#forceDelete. - FIX: XmlModuleDescriptorUpdater is a mess that produces broken xmls in many cases (IVY-1010) - FIX: ivy.xml that contains UTF-8 encoded umlauts cannot be bigger than 10000 bytes (IVY-1253) Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java?rev=1055675&r1=1055674&r2=1055675&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java Wed Jan 5 22:55:07 2011 @@ -25,6 +25,7 @@ import java.util.Map; import java.util.Set; import org.apache.ivy.core.module.id.ModuleId; +import org.apache.ivy.core.module.id.ModuleRevisionId; import org.apache.ivy.plugins.conflict.ConflictManager; public class IvyNodeEviction { @@ -227,8 +228,16 @@ public class IvyNodeEviction { Collection resolvedRevs = new HashSet(); for (Iterator iter = resolved.iterator(); iter.hasNext();) { IvyNode node = (IvyNode) iter.next(); + ModuleRevisionId resolvedId = node.getResolvedId(); resolvedRevs.add(node.getId()); - resolvedRevs.add(node.getResolvedId()); + resolvedRevs.add(resolvedId); + + // in case there are extra attributes on the resolved module we also add the + // the module without these extra attributes (cfr. IVY-1236) + if (!resolvedId.getExtraAttributes().isEmpty()) { + resolvedRevs.add(ModuleRevisionId.newInstance(resolvedId.getOrganisation(), + resolvedId.getName(), resolvedId.getBranch(), resolvedId.getRevision())); + } } return resolvedRevs; } @@ -274,14 +283,18 @@ public class IvyNodeEviction { public boolean isEvicted(String rootModuleConf) { cleanEvicted(); + if (node.isRoot()) { + return false; + } + EvictionData evictedData = getEvictedData(rootModuleConf); + if (evictedData == null) { + return false; + } IvyNode root = node.getRoot(); ModuleId moduleId = node.getId().getModuleId(); Collection resolvedRevisions = root.getResolvedRevisions(moduleId, rootModuleConf); - EvictionData evictedData = getEvictedData(rootModuleConf); - return root != node && evictedData != null - && (!resolvedRevisions.contains(node.getResolvedId()) - || evictedData.isTransitivelyEvicted() - ); + return !resolvedRevisions.contains(node.getResolvedId()) + || evictedData.isTransitivelyEvicted(); } public boolean isCompletelyEvicted() { 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=1055675&r1=1055674&r2=1055675&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 Wed Jan 5 22:55:07 2011 @@ -3347,6 +3347,24 @@ public class ResolveTest extends TestCas assertFalse(getArchiveFileInCache("myorg", "modE", "1.1", "modE", "jar", "jar").exists()); } + public void testIVY1236() throws Exception { + Ivy ivy = new Ivy(); + ivy.configure(new File("test/repositories/IVY-1236/ivysettings.xml")); + ResolveReport report = ivy.resolve(new File("test/repositories/IVY-1236/ivy.xml").toURI().toURL(), + getResolveOptions(new String[] {"*"})); + + assertNotNull(report); + assertNotNull(report.getUnresolvedDependencies()); + assertEquals("Number of unresolved dependencies not correct", 0, report + .getUnresolvedDependencies().length); + + // dependencies + assertTrue(getIvyFileInCache( + ModuleRevisionId.newInstance("myorg", "modB", "1.0")).exists()); + assertTrue(getArchiveFileInCache("myorg", "modB", "1.0", "modB", "jar", "jar").exists()); + assertTrue(getArchiveFileInCache("myorg", "modB", "1.0", "modB-A", "jar", "jar").exists()); + } + public void testIVY999() throws Exception { Ivy ivy = new Ivy(); ivy.configure(new File("test/repositories/IVY-999/ivysettings.xml")); Added: ant/ivy/core/trunk/test/repositories/IVY-1236/ivy.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/IVY-1236/ivy.xml?rev=1055675&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/IVY-1236/ivy.xml (added) +++ ant/ivy/core/trunk/test/repositories/IVY-1236/ivy.xml Wed Jan 5 22:55:07 2011 @@ -0,0 +1,29 @@ + + + + + + + + + + + + Added: ant/ivy/core/trunk/test/repositories/IVY-1236/ivysettings.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/IVY-1236/ivysettings.xml?rev=1055675&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/IVY-1236/ivysettings.xml (added) +++ ant/ivy/core/trunk/test/repositories/IVY-1236/ivysettings.xml Wed Jan 5 22:55:07 2011 @@ -0,0 +1,28 @@ + + + + + + + + + + + Added: ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modA/1.0/ivy.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modA/1.0/ivy.xml?rev=1055675&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modA/1.0/ivy.xml (added) +++ ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modA/1.0/ivy.xml Wed Jan 5 22:55:07 2011 @@ -0,0 +1,28 @@ + + + + + + + + + + + Added: ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/ivy.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/ivy.xml?rev=1055675&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/ivy.xml (added) +++ ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/ivy.xml Wed Jan 5 22:55:07 2011 @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + Added: ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/modB-A.jar URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/modB-A.jar?rev=1055675&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/modB-A.jar (added) +++ ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/modB-A.jar Wed Jan 5 22:55:07 2011 @@ -0,0 +1 @@ +. \ No newline at end of file Added: ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/modB.jar URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/modB.jar?rev=1055675&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/modB.jar (added) +++ ant/ivy/core/trunk/test/repositories/IVY-1236/myorg/modB/1.0/modB.jar Wed Jan 5 22:55:07 2011 @@ -0,0 +1 @@ +. \ No newline at end of file