[ 
http://jira.codehaus.org/browse/MVERSIONS-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=254965#action_254965
 ] 

Yongjun Rong commented on MVERSIONS-142:
----------------------------------------

This is the tested patch.{noformat}
ndex: src/main/java/org/codehaus/mojo/versions/api/AbstractVersionDetails.java
===================================================================
--- src/main/java/org/codehaus/mojo/versions/api/AbstractVersionDetails.java    
(revision 61903)
+++ src/main/java/org/codehaus/mojo/versions/api/AbstractVersionDetails.java    
(working copy)
@@ -169,8 +169,8 @@
             {
                 continue;
             }
-            int lower = lowerBound == null ? -1 : versionComparator.compare( 
lowerBound, candidate );
-            int upper = upperBound == null ? +1 : versionComparator.compare( 
upperBound, candidate );
+            int lower = lowerBound == null || (!includeSnapshots && 
ArtifactUtils.isSnapshot( lowerBound.toString())) ? -1 : 
versionComparator.compare( lowerBound, candidate );
+            int upper = upperBound == null || (!includeSnapshots && 
ArtifactUtils.isSnapshot( upperBound.toString())) ? +1 : 
versionComparator.compare( upperBound, candidate );
             if ( lower > 0 || upper < 0 )
             {
                 continue;

{noformat}

> Cannot find the latest released version(ex. 1.0.8-a)  when the current 
> dependency version is a snapshot version (ex. 1.0.9-SNAPSHOT) which is higher 
> than the latest released version (ex. 1.0.8-a) 
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MVERSIONS-142
>                 URL: http://jira.codehaus.org/browse/MVERSIONS-142
>             Project: Maven 2.x Versions Plugin
>          Issue Type: Bug
>            Reporter: Yongjun Rong
>
> When it define a dependency version point to a latest snapshot version (ex. 
> 1.0.9-SNAPSHOT) which is higher than the latest released version (ex. 
> 1.0.8-a) , version plugin cannot update the dependency released version to 
> 1.0.8-a correctly when "-DallowSnapshots=false". It still use the current 
> snapshot version(1.0.9-SNAPSHOT) because it is higher than the latest 
> released version (1.0.8-a) based on the default maven version comparing 
> pattern.

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

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to