ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r704265 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java
Date Mon, 13 Oct 2008 21:42:27 GMT
Author: maartenc
Date: Mon Oct 13 14:42:26 2008
New Revision: 704265

URL: http://svn.apache.org/viewvc?rev=704265&view=rev
Log:
FIX: Unable to resolve snapshot versions depending on xml elements order (IVY-940)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=704265&r1=704264&r2=704265&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Oct 13 14:42:26 2008
@@ -102,6 +102,7 @@
 - FIX: Maven2 parser doesn't support POMs with <model> as root (IVY-932)
 - FIX: Default retrieve, publish and deliver patterns doesn't include the [classifier] token
(IVY-935)
 - FIX: Can't use latest.release for pom dependencies (IVY-936)
+- FIX: Unable to resolve snapshot versions depending on xml elements order (IVY-940)
 
    2.0.0-rc1
 =====================================

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java?rev=704265&r1=704264&r2=704265&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java Mon Oct
13 14:42:26 2008
@@ -167,25 +167,26 @@
                 Resource metadata = getRepository().getResource(metadataLocation);
                 if (metadata.exists()) {
                     metadataStream = metadata.openStream();
-                    final StringBuffer snapshotRev = new StringBuffer();
+                    final StringBuffer timestamp = new StringBuffer();
+                    final StringBuffer buildNumer = new StringBuffer();
                     XMLHelper.parse(metadataStream, null, new ContextualSAXHandler() {
                         public void endElement(String uri, String localName, String qName)

                                 throws SAXException {
                             if ("metadata/versioning/snapshot/timestamp".equals(getContext()))
{
-                                snapshotRev.append(getText()).append("-");
+                                timestamp.append(getText());
                             }
                             if ("metadata/versioning/snapshot/buildNumber"
                                     .equals(getContext())) {
-                                snapshotRev.append(getText());
+                                buildNumer.append(getText());
                             }
                             super.endElement(uri, localName, qName);
                         }
                     }, null);
-                    if (snapshotRev.indexOf("-") != -1) {
+                    if (timestamp.length() > 0) {
                         // we have found a timestamp, so this is a snapshot unique version
                         String rev = mrid.getRevision();
                         rev = rev.substring(0, rev.length() - "SNAPSHOT".length());
-                        rev += snapshotRev;
+                        rev = rev + timestamp.toString() + "-" + buildNumer.toString();
                         
                         return rev;
                     }



Mime
View raw message