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

Marek Budyn commented on MNG-6232:
----------------------------------

Well, I can imagine that maven artifact resolves versions as you shown, still I 
believe that this not what one would expect.
First, 1.8-alpha seems to be quite different version branch. Even if you 
specify range like [1.0,2.0), 2.0-alpha artifacts (which tend to be 
incompatible with 1.0) will be included, which I believe is totally unwanted 
behavior
Secondly, there is (as far as I know) no other way to prevent alpha artifacts 
to be excluded, except of putting everywhere -alpha qualifier (which looks 
bizarre when you specify all ranges like [1.0,2.0-alpha); [1.7,1.8-alpha)
Finally, one can never be sure if someone will not release 'alpha' artifact 
breaking all dependencies.

So, as I was unable to find kind of 'official' guide about version resolution 
for alpha/beta stuff, could you, please, guide me to the official spec of 
version resolution in maven? Like if putting -alpha at the right side of 
version ranges will always prevent higher branch artifacts from being included?
And maybe there should be a way to exclude alpha/beta/snapshot releases in 
version range which I provided ?


> 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)

Reply via email to