karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pie...@apache.org
Subject svn commit: r1240650 - /karaf/branches/karaf-2.2.x/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/AddFeaturesToRepoMojo.java
Date Sun, 05 Feb 2012 00:27:29 GMT
Author: pieber
Date: Sun Feb  5 00:27:28 2012
New Revision: 1240650

URL: http://svn.apache.org/viewvc?rev=1240650&view=rev
Log:
[KARAF-1182] Karaf features-maven-plugin always selects lowest version in range (thx to to
Jonathan Anstey for the patch)

Signed-off-by: Andreas Pieber <anpieber@gmail.com>

Modified:
    karaf/branches/karaf-2.2.x/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/AddFeaturesToRepoMojo.java

Modified: karaf/branches/karaf-2.2.x/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/AddFeaturesToRepoMojo.java
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/AddFeaturesToRepoMojo.java?rev=1240650&r1=1240649&r2=1240650&view=diff
==============================================================================
--- karaf/branches/karaf-2.2.x/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/AddFeaturesToRepoMojo.java
(original)
+++ karaf/branches/karaf-2.2.x/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/AddFeaturesToRepoMojo.java
Sun Feb  5 00:27:28 2012
@@ -280,18 +280,19 @@ public class AddFeaturesToRepoMojo exten
                 version = feature.substring(delimIndex + 1);
                 feature = feature.substring(0, delimIndex);
             }
-            
+ 
             Feature f = null;
             if (version != null) {
                 // looking for a specific feature with name and version
                 f = featuresMap.get(feature + "/" + version);
             } else {
-                // looking for the first feature name (whatever the version is)
+                // looking for the feature name (with the greatest version)
                 for (String key : featuresMap.keySet()) {
                     String[] nameVersion = key.split("/");
                     if (feature.equals(nameVersion[0])) {
-                        f = featuresMap.get(key);
-                        break;
+                        if (f == null || f.getVersion().compareTo(featuresMap.get(key).getVersion())
< 0) {
+                            f = featuresMap.get(key);
+                        }
                     }
                 }
             }



Mime
View raw message