[ http://jira.codehaus.org/browse/MNG-5066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Bentmann closed MNG-5066. ---------------------------------- Resolution: Duplicate Assignee: Benjamin Bentmann > Unable to customize Dependencies version ordering while using range in > dependency version tag > ---------------------------------------------------------------------------------------------- > > Key: MNG-5066 > URL: http://jira.codehaus.org/browse/MNG-5066 > Project: Maven 2 & 3 > Issue Type: Improvement > Components: Artifacts and Repositories, Dependencies > Affects Versions: 2.2.1 > Reporter: Aziz Joumady > Assignee: Benjamin Bentmann > Priority: Minor > > Hi all, > Currently, Maven fails to properly resolve dependencies while version follow > this pattern : > [0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*-[alpha|beta|rc]-[0-9][0-9]* > e.g. > 1.0.0-alpha-2 > 1.0.0-alpha-10 > 1.0.0-beta-3 > etc. > As described in following link > http://www.sonatype.com/books/maven-book/reference/pom-relationships-sect-pom-syntax.html > {quote} > One gotcha for release version numbers is the ordering of the qualifiers. > Take the version release numbers "1.2.3-alpha-2" and "1.2.3-alpha-10", where > the "alpha-2" build corresponds to the 2nd alpha build, and the "alpha-10" > build corresponds to the 10th alpha build. Even though "alpha-10" should be > considered more recent than "alpha-2", Maven is going to sort "alpha-10" > before "alpha-2" due to a known issue in the way Maven handles version > numbers. > Maven is supposed to treat the number after the qualifier as a build number. > In other words, the qualifier should be "alpha", and the build number should > be 2. Even though Maven has been designed to separate the build number from > the qualifier, this parsing is currently broken. As a result, "alpha-2" and > "alpha-10" are compared using a String comparison, and "alpha-10" comes > before "alpha-2" alphabetically. To get around this limitation, you will need > to left-pad your qualified build numbers. If you use "alpha-02" and > "alpha-10" this problem will go away, and it will continue to work once Maven > properly parses the version build number. > {quote} > Is it possible to add a new feature enabling to customize the way Maven > compares version resolution? > Adding for example a regular expression pattern. > Kind regards, > Aziz -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira