You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Karl Heinz Marbaise (JIRA)" <ji...@apache.org> on 2017/05/13 09:25:04 UTC

[jira] [Commented] (MNG-6232) Version range is not resolved correctly

    [ https://issues.apache.org/jira/browse/MNG-6232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16009238#comment-16009238 ] 

Karl Heinz Marbaise commented on MNG-6232:
------------------------------------------

The simple answer to this is: {{1.8.0-alpha-2}} is less than {{1.8}} which fulfils the requirement of the given range {{&#91;1.7,1.8)}}. A little more in detail.
The version range {{&#91;1.7,1.8)}} just means greater or equal {{1.7}} and less than {{1.8}}. By definition {{1.8-alpha-2}} is less than {{1.8}} which means in consequence less than {{1.8}} which will fulfil the requirement. This can be checked by using
{code}
java -jar apache-maven-3.3.3/lib/maven-artifact-3.3.3.jar 1.8 1.8-alpha-2
{code}
(Works with newer Maven versions as well).
This will printout:
{code}
Display parameters as parsed by Maven (in canonical form) and comparison result:
1. 1.8 == 1.8
   1.8 > 1.8-alpha-2
2. 1.8-alpha-2 == 1.8-alpha-2
{code}


> Version range is not resolved correctly
> ---------------------------------------
>
>                 Key: MNG-6232
>                 URL: https://issues.apache.org/jira/browse/MNG-6232
>             Project: Maven
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 3.3.3
>            Reporter: Marek Budyn
>         Attachments: pom.xml
>
>
> When dependency is specified as range, e.g slf4j-api version [1.7, 1.8) as in provided pom.xml, one would expect to resolver to version 1.7.X (e.g. 1.7.25). Instead maven resolves version 1.8.0-alpha 2.
> Output of command 'mvn dependenct:tree' on provided pom.xml:
> [INFO] Scanning for projects...
> [INFO]                                                                         
> [INFO] ------------------------------------------------------------------------
> [INFO] Building project 1.0.0-SNAPSHOT
> [INFO] ------------------------------------------------------------------------
> [INFO] 
> [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ project ---
> [INFO] test:project:jar:1.0.0-SNAPSHOT
> [INFO] \- org.slf4j:slf4j-api:jar:1.8.0-alpha2:compile
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 1.273 s
> [INFO] Finished at: 2017-05-12T23:37:02+02:00
> [INFO] Final Memory: 13M/225M
> [INFO] ------------------------------------------------------------------------



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)