[ 
http://jira.codehaus.org/browse/MNG-3001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_102472
 ] 

Barrie Treloar commented on MNG-3001:
-------------------------------------

Also, snapshots can be in your local repository and will be resolved that way, 
regardless of whether a remote snapshot repository was declared in the build 
proces.

Since they are in the loca repo, if they are included as Kenney suggests, then 
there is no way to not include them.

I am happy with the spec only included released versions (which is generally 
what you want)
If you want a snapshot version you would be not specifying the version 
information at all and just pick up the latest from a snapshot repo.


> Maven2 does not resolve version ranges correctly [PATCH INCLUDED]
> -----------------------------------------------------------------
>
>                 Key: MNG-3001
>                 URL: http://jira.codehaus.org/browse/MNG-3001
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Artifacts and Repositories
>    Affects Versions: 2.0.4, 2.0.6
>         Environment: Windows.  Affects versions 2.04 & 2.06 minimum.
>            Reporter: David Hoffer
>            Assignee: Jason van Zyl
>            Priority: Blocker
>             Fix For: Reviewed Pending Version Assignment
>
>         Attachments: VersionRangeSnapshotFix.patch
>
>
> Maven does not properly handle version ranges when the high end is unbounded. 
>  The spec clearly states that it should not resolve to a SNAPSHOT unless 
> included as an explicit boundary.  Currently maven2 does resolve to a 
> SNAPSHOT which makes usage of version ranges to control versions of 
> dependencies unworkable.  (We currently use a local build of maven with this 
> fix else we could not use version ranges.  This is a major issue can you 
> please include in the next release?)
> Code fix and unit tests are included.
> Example:
> <dependency>
> <groupId>myGroup</groupId>
> <artifactId>myArtifact</artifactId>
> <version>[1.0,)</version>
> </dependency>
> This version range can resolve to the latest development 1.0-SNAPSHOT. All 
> artifact dependencies should ignore SNAPSHOTS as that is not intended by the 
> unbounded high end of the version range. This should resolve to any released 
> version of 1.1 or higher.
> This document:
> http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges
> addressed the requirements for version ranges and stated that "Resolution of 
> dependency ranges should not resolve to a snapshot (development version) 
> unless it is included as an explicit boundary". I think this requirement was 
> forgotten when version ranges were implemented.
> I have included a patch for this bug. The fix is in the containsVersion 
> method of VersionRange. I have added tests in VersionRangeTest and 
> DefaultArtifactCollectorTest. All tests in maven pass with this fix.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to