Uploaded image for project: 'Ivy'
  1. Ivy
  2. IVY-940

unable to resolve snapshot versions depending on xml elements order

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0-RC1
    • 2.0-RC2
    • Maven Compatibility
    • None

    Description

      Depending on the order of the timestamp and buildnumber elements the fix done in IVY-501 does not work.

      Here a possible fix

      In IBiblioResolver.java line 171

       
                          XMLHelper.parse(metadataStream, null, new ContextualSAXHandler() {
                              String buildNumber="";
                              boolean timestampFound;	
                              boolean buildNumberFound;	
                              public void endElement(String uri, String localName, String qName) 
                                      throws SAXException {
                                  if ("metadata/versioning/snapshot/timestamp".equals(getContext())) {
                                      snapshotRev.append(getText()).append("-");
                                      timestampFound=true;
                                      if(buildNumberFound){
                                  		snapshotRev.append(buildNumber);
                                      }
                                  }
                                  if ("metadata/versioning/snapshot/buildNumber"
                                          .equals(getContext())) {
                                  	buildNumberFound=true;
                                  	if(timestampFound){
                                  		snapshotRev.append(getText());
                                  	}else{
                                  		buildNumber=getText();
                                  	}
                                  }
                                  super.endElement(uri, localName, qName);
                              }
                          }, null);
      
      

      Attachments

        Activity

          People

            maartenc Maarten Coene
            adejung Andreas Dejung
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: