Author: maartenc
Date: Thu Dec 20 23:16:22 2012
New Revision: 1424748

URL: http://svn.apache.org/viewvc?rev=1424748&view=rev
Log:
FIX: Ivy generates wrong revision in URL for Maven snapshots (IVY-1396) (merged 
from trunk)

Added:
    
ant/ivy/core/branches/2.3.x/test/repositories/m2/org/apache/test-SNAPSHOT1/2.0.0-SNAPSHOT/
      - copied from r1424745, 
ant/ivy/core/trunk/test/repositories/m2/org/apache/test-SNAPSHOT1/2.0.0-SNAPSHOT/
    
ant/ivy/core/branches/2.3.x/test/repositories/m2/org/apache/test-SNAPSHOT1/2.0.0-SNAPSHOT/maven-metadata.xml
      - copied unchanged from r1424745, 
ant/ivy/core/trunk/test/repositories/m2/org/apache/test-SNAPSHOT1/2.0.0-SNAPSHOT/maven-metadata.xml
    
ant/ivy/core/branches/2.3.x/test/repositories/m2/org/apache/test-SNAPSHOT1/2.0.0-SNAPSHOT/test-SNAPSHOT1-2.0.0-20070310.181613-3.jar
      - copied unchanged from r1424745, 
ant/ivy/core/trunk/test/repositories/m2/org/apache/test-SNAPSHOT1/2.0.0-SNAPSHOT/test-SNAPSHOT1-2.0.0-20070310.181613-3.jar
    
ant/ivy/core/branches/2.3.x/test/repositories/m2/org/apache/test-SNAPSHOT1/2.0.0-SNAPSHOT/test-SNAPSHOT1-2.0.0-20070310.181613-3.pom
      - copied unchanged from r1424745, 
ant/ivy/core/trunk/test/repositories/m2/org/apache/test-SNAPSHOT1/2.0.0-SNAPSHOT/test-SNAPSHOT1-2.0.0-20070310.181613-3.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/resolver/IBiblioResolver.java
    
ant/ivy/core/branches/2.3.x/test/repositories/m2/org/apache/test-SNAPSHOT1/maven-metadata.xml

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

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=1424748&r1=1424747&r2=1424748&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/CHANGES.txt (original)
+++ ant/ivy/core/branches/2.3.x/CHANGES.txt Thu Dec 20 23:16:22 2012
@@ -130,6 +130,7 @@ for detailed view of each issue, please 
        
    2.3.x
 =====================================
+- FIX: Ivy generates wrong revision in URL for Maven snapshots (IVY-1396)
 - FIX: Maven2: resolve failure when parent has <dependencyManagement> with 
dependency in 'import' scope (IVY-1376)
 - FIX: IvyPublish fails when using extend tags with no explicit location 
attribute (IVY-1391)
 - FIX: *.lck files created by "artifact-lock" lock strategy are not cleaned up 
if ivy quits abruptly (IVY-1388) (thanks to Wei Chen)

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=1424748&r1=1424747&r2=1424748&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 Dec 20 23:16:22 2012
@@ -400,14 +400,16 @@ public class IBiblioResolver extends URL
                 for (Iterator iter = revs.iterator(); iter.hasNext();) {
                     String rev = (String) iter.next();
                     ModuleRevisionId historicalMrid = 
ModuleRevisionId.newInstance(mrid, rev);
+
+                    String patternForRev = pattern;
                     if (rev.endsWith("SNAPSHOT")) {
                         String snapshotVersion = 
findSnapshotVersion(historicalMrid);
                         if (snapshotVersion != null) {
-                            pattern = 
pattern.replaceFirst("\\-\\[revision\\]", "-" + snapshotVersion);
+                            patternForRev = 
pattern.replaceFirst("\\-\\[revision\\]", "-" + snapshotVersion);
                         }
                     }
                     String resolvedPattern = IvyPatternHelper.substitute(
-                        pattern, historicalMrid, artifact);
+                        patternForRev, historicalMrid, artifact);
                     try {
                         Resource res = repository.getResource(resolvedPattern);
                         if ((res != null) && res.exists()) {

Modified: 
ant/ivy/core/branches/2.3.x/test/repositories/m2/org/apache/test-SNAPSHOT1/maven-metadata.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/test/repositories/m2/org/apache/test-SNAPSHOT1/maven-metadata.xml?rev=1424748&r1=1424747&r2=1424748&view=diff
==============================================================================
--- 
ant/ivy/core/branches/2.3.x/test/repositories/m2/org/apache/test-SNAPSHOT1/maven-metadata.xml
 (original)
+++ 
ant/ivy/core/branches/2.3.x/test/repositories/m2/org/apache/test-SNAPSHOT1/maven-metadata.xml
 Thu Dec 20 23:16:22 2012
@@ -23,6 +23,7 @@
   <version>2.0.2-SNAPSHOT</version>
   <versioning>
     <versions>
+      <version>2.0.0-SNAPSHOT</version>
       <version>2.0.2-SNAPSHOT</version>
     </versions>
 


Reply via email to