Return-Path: X-Original-To: apmail-ant-notifications-archive@minotaur.apache.org Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 94F8CD514 for ; Thu, 18 Oct 2012 19:33:04 +0000 (UTC) Received: (qmail 73906 invoked by uid 500); 18 Oct 2012 19:33:03 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 73567 invoked by uid 500); 18 Oct 2012 19:32:56 -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 73496 invoked by uid 99); 18 Oct 2012 19:32:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2012 19:32:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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, 18 Oct 2012 19:32:52 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4D9622388A91 for ; Thu, 18 Oct 2012 19:32:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1399811 - in /ant/ivy/core/branches/2.3.x: ./ CHANGES.txt src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java test/java/org/apache/ivy/core/resolve/ResolveTest.java Date: Thu, 18 Oct 2012 19:32:09 -0000 To: notifications@ant.apache.org From: maartenc@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121018193209.4D9622388A91@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: maartenc Date: Thu Oct 18 19:32:08 2012 New Revision: 1399811 URL: http://svn.apache.org/viewvc?rev=1399811&view=rev Log: Merged changes for IVY-1036 from trunk. 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/resolver/IBiblioResolver.java ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/core/resolve/ResolveTest.java Propchange: ant/ivy/core/branches/2.3.x/ ------------------------------------------------------------------------------ Merged /ant/ivy/core/trunk:r1398531-1399805 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=1399811&r1=1399810&r2=1399811&view=diff ============================================================================== --- ant/ivy/core/branches/2.3.x/CHANGES.txt (original) +++ ant/ivy/core/branches/2.3.x/CHANGES.txt Thu Oct 18 19:32:08 2012 @@ -130,6 +130,7 @@ for detailed view of each issue, please 2.3.x ===================================== +- FIX: latest.integration isn't resolved against a Maven snapshot repository (when uniqueVersion = true) (IVY-1036) - FIX: Resolve does not deliver all dependent artifacts (IVY-1366) (thanks to Wolfgang Frank) - FIX: Ivy descriptors are merged incorrectly when there is an element (IVY-1356) - FIX: SimpleDateFormat is not thread safe (IVY-1373) Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java?rev=1399811&r1=1399810&r2=1399811&view=diff ============================================================================== --- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java (original) +++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java Thu Oct 18 19:32:08 2012 @@ -399,8 +399,15 @@ public class IBiblioResolver extends URL List rres = new ArrayList(); for (Iterator iter = revs.iterator(); iter.hasNext();) { String rev = (String) iter.next(); + ModuleRevisionId historicalMrid = ModuleRevisionId.newInstance(mrid, rev); + if (rev.endsWith("SNAPSHOT")) { + String snapshotVersion = findSnapshotVersion(historicalMrid); + if (snapshotVersion != null) { + pattern = pattern.replaceFirst("\\-\\[revision\\]", "-" + snapshotVersion); + } + } String resolvedPattern = IvyPatternHelper.substitute( - pattern, ModuleRevisionId.newInstance(mrid, rev), artifact); + pattern, historicalMrid, artifact); try { Resource res = repository.getResource(resolvedPattern); if ((res != null) && res.exists()) { 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=1399811&r1=1399810&r2=1399811&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 Thu Oct 18 19:32:08 2012 @@ -4602,6 +4602,26 @@ public class ResolveTest extends TestCas "test-SNAPSHOT1", "jar", "jar").exists()); } + public void testResolveMaven2Snapshot1AsLatestIntegration() throws Exception { + // test case for IVY-1036 + // here we test maven SNAPSHOT versions handling, + // with m2 snapshotRepository/uniqueVersion set to true + // but retrieving by latest.integration + Ivy ivy = new Ivy(); + ivy.configure(new File("test/repositories/m2/ivysettings.xml")); + ResolveReport report = ivy.resolve( + ModuleRevisionId.newInstance("org.apache", "test-SNAPSHOT1", "latest.integration"), + getResolveOptions(new String[] {"*(public)"}), true); + assertNotNull(report); + assertFalse(report.hasError()); + + // dependencies + assertTrue(getIvyFileInCache( + ModuleRevisionId.newInstance("org.apache", "test-SNAPSHOT1", "2.0.2-SNAPSHOT")).exists()); + assertTrue(getArchiveFileInCache(ivy, "org.apache", "test-SNAPSHOT1", "2.0.2-SNAPSHOT", + "test-SNAPSHOT1", "jar", "jar").exists()); + } + public void testResolveMaven2Snapshot2() throws Exception { // test case for IVY-501 // here we test maven SNAPSHOT versions handling, @@ -4621,6 +4641,26 @@ public class ResolveTest extends TestCas "test-SNAPSHOT2", "jar", "jar").exists()); } + public void testResolveMaven2Snapshot2AsLatestIntegration() throws Exception { + // test case for IVY-1036 + // here we test maven SNAPSHOT versions handling, + // with m2 snapshotRepository/uniqueVersion set to true + // but retrieving by latest.integration + Ivy ivy = new Ivy(); + ivy.configure(new File("test/repositories/m2/ivysettings.xml")); + ResolveReport report = ivy.resolve( + ModuleRevisionId.newInstance("org.apache", "test-SNAPSHOT2", "latest.integration"), + getResolveOptions(new String[] { "*(public)" }), true); + assertNotNull(report); + assertFalse(report.hasError()); + + // dependencies + assertTrue(getIvyFileInCache( + ModuleRevisionId.newInstance("org.apache", "test-SNAPSHOT2", "2.0.2-SNAPSHOT")) + .exists()); + assertTrue(getArchiveFileInCache(ivy, "org.apache", "test-SNAPSHOT2", "2.0.2-SNAPSHOT", + "test-SNAPSHOT2", "jar", "jar").exists()); + } public void testNamespaceMapping() throws Exception { // the dependency is in another namespace