[ https://jira.codehaus.org/browse/MNG-3092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=314116#comment-314116 ]
Mark Derricutt commented on MNG-3092: ------------------------------------- +1 on pushing to 3.1.1 - I'd rather see some good thoughts/docs and consensus before making any changes here. As Herve mentions the problem is not so much the range resolution, but the version *selection* - an initial thought of mine requires POM schema changes: adding <selection>lowerbound/upperbound</selection> and <snapshots><enabled>true</enabled></snapshots> (or similar) to the <dependency> element - <selection> could be default to upperbound ( existing behaviour ) or even defaulted to that for <compile> scope, lowerbound for test. One could even do that without changing the pom, but it is a change in behaviour. Since the introduction of the dependency:purge-local-repository goal I've also come to add that to my release plugins prepareGoals, this forces any local -SNAPSHOTs to be removed during a release so only released artifacts get used - this actually solves 90% of my initial "no snapshots in ranges" problems. > 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 > > > 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: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira