Ivy
  1. Ivy
  2. IVY-1177

Can't deal with [VERSION] version pattern from Maven

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.2.0-RC1
    • Component/s: None
    • Labels:
      None
    • Environment:

      Windows XP and Mac OS

      Description

      If you want a specific version of a resource in Maven, [VERSION] is a valid request - e.g. [1.5.8]

      I am using grape (from Groovy) and

      grape -d install org.slf4j slf4j-api [1.5.8]

      will not work. These dependencies are all over the place in our maven repo (and presumably others). I fixed it by adding to ModuleRevisionId.java

      protected static String normalizeRevision(String asked) {
      if ( asked.startsWith( "[" ) && asked.endsWith( "]" ) && asked.indexOf(',') == -1 )

      { return asked.substring(1, asked.length() - 1 ); }

      else
      return asked;
      }

      and using it in the constructor:

      this.revision = revision == null ? Ivy.getWorkingRevision() : normalizeRevision(revision);

        Activity

        Richard Vowles created issue -
        Hide
        Maarten Coene added a comment -

        I've applied your patch in SVN trunk.
        Thanks for the contribution!

        Maarten

        Show
        Maarten Coene added a comment - I've applied your patch in SVN trunk. Thanks for the contribution! Maarten
        Maarten Coene made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Maarten Coene [ maartenc ]
        Fix Version/s trunk [ 12313426 ]
        Resolution Fixed [ 1 ]
        Maarten Coene made changes -
        Fix Version/s 2.2.0-RC1 [ 12315013 ]
        Fix Version/s trunk [ 12313426 ]

          People

          • Assignee:
            Maarten Coene
            Reporter:
            Richard Vowles
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development