[ 
https://jira.codehaus.org/browse/MNG-3092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=322888#comment-322888
 ] 

Sergei Ivanov commented on MNG-3092:
------------------------------------

@Joniec:
Are you concerned about the way it is going to be handled in IDEs? I personally 
don't see that being a problem, although IDE vendors may need to implement the 
equivalent of a command line option for embedded Maven engines.

To your example. Let us elaborate on it a bit, so that we can be sure that we 
are all on the same page.

Suppose we have project A. Local version of project A is 1.0.1-SNAPSHOT, remote 
repo contains versions 1.0.0 and 1.0.1-SNAPSHOT.

Then we have project B, local version 2.1.0-SNAPSHOT, which depends on A with a 
defined version range of [1.0.0,1.0.1].

If we build B on command line with {{-DenableSnapshotsInRanges=false}} flag, 
then B picks up A:1.0.0, otherwise it picks up A:1.0.1-SNAPSHOT. If we release 
project A, then regardless of the flag B will pick up A:1.0.1, because the new 
snapshot A:1.0.2-SNAPSHOT will fall out of [1.0.0,1.0.1] range.

Now, suppose we open both A:1.0.1-SNAPSHOT and B:2.1.0-SNAPSHOT in an IDE. The 
default resolution behaviour is that snapshots are included in ranges, thus our 
projects will be linked together inside the IDE, which is typically the desired 
outcome. If we only open project B in the IDE, or the local version of project 
A falls outside of the range defined in project B, then IDE resolves B's 
dependency from the local/remote repo in a default way (unless the IDE offers 
some degree of control over it). If we want to peg B's dependency on A, we edit 
the local POM, which is no worse than the alternative proposal of including 
snapshot versions in ranges explicitly, and then editing them again before 
releasing the project.
                
> Version ranges with non-snapshot bounds can contain snapshot versions
> ---------------------------------------------------------------------
>
>                 Key: MNG-3092
>                 URL: https://jira.codehaus.org/browse/MNG-3092
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Dependencies
>            Reporter: Mark Hobson
>            Assignee: Jason van Zyl
>             Fix For: 3.1.1
>
>         Attachments: MNG-3092.patch, MNG-3092.patch
>
>
> Contrary to the 2.0 design docs:
> "Resolution of dependency ranges should not resolve to a snapshot 
> (development version) unless it is included as an explicit boundary."
> -- from 
> http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-Incorporating%7B%7BSNAPSHOT%7D%7Dversionsintothespecification
> The following is equates to true:
> VersionRange.createFromVersionSpec( "[1.0,1.1]" ).containsVersion( new 
> DefaultArtifactVersion( "1.1-SNAPSHOT" ) )
> The attached patch only allows snapshot versions to be contained in a range 
> if they are equal to one of the boundaries.  Note that this is a strict 
> equality, so [1.0,1.2-SNAPSHOT] will not contain 1.1-SNAPSHOT.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to