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

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

Joniec,

We have already waited for 6 long years and this issue is still unsolved. If we 
have a solution that works with command line maven and can be used in CI tools, 
I'll be happy to wait until IDEs catch up. We have already been in such 
situation with incompatible changes in tools and libraries, and it's part of 
software evolution.

To your question. Whenever I want to release a SNAPSHOT of one of our projects, 
I open our Jenkins page, find the release build for the project and press a 
"Perform Maven Release" button. This in turn kicks off command line maven with 
the equivalent of {{mvn -B release:prepare-with-pom release:perform}} command, 
with a couple of additional options specific to our build environment.

I do not have to edit the project's POM before release, because for our release 
builds version ranges are resolved from release repositories only, and the 
release builds are configured with a separate local repo. I have already 
described our set-up 
[above|https://jira.codehaus.org/browse/MNG-3092?focusedCommentId=313516&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-313516].
 All this hassle is to circumvent this very MNG-3092 and avoid unnecessary 
editing of POM files.

Neither do I have to constantly edit version ranges in the dependent downstream 
projects, save for the cases when a major release of upstream dependency is 
produced and the whole version range needs to be shifted.

I understand that there may be use cases where e.g. project A has version 
ranges for projects B and C, is happy to use snapshots of B, but only wants 
releases of C. In that case the project needs finer-grained control over 
snapshot dependencies, and this may require:
# [changes to the POM 
model|https://jira.codehaus.org/browse/MNG-3092?focusedCommentId=322913&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-322913],
 or
# [changes to the way ranges are 
defined|https://jira.codehaus.org/browse/MNG-3092?focusedCommentId=140552&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-140552],
 or
# re-interpretation of dependency ranges (as in Kunalkumar's 
[suggestion|https://jira.codehaus.org/browse/MNG-3092?focusedCommentId=322366&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-322366])

Having thought about that, perhaps we do really need to split this issue in two:
# Have a master switch that will disable all snapshots in all ranges. Use it by 
default in maven-release-plugin when starting forked executions. That will 
solve integration and CI issues for a large group of users, including us.
# Have a fine-grained control over inclusion of snapshots in ranges, on the 
level of each individual dependency. That will cover more specific cases like 
you are describing.
                
> 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