Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2820

features-maven-plugin:add-features-to-repo adds wrong transitive feature version

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3.4
    • 2.4.0, 3.0.1, 2.3.5, 4.0.0.M3
    • karaf
    • None

    Description

      features-maven-plugin:add-features-to-repo tries to find greatest version of transitive feature to add. But the problem is it compares versions as string. So, for example, "2.7.7" > "2.7.10".
      Here is that part in tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/AddFeaturesToRepoMojo.java

      313 // looking for the feature name (with the greatest version)
      314 for (String key : featuresMap.keySet()) {
      315 String[] nameVersion = key.split("/");
      316 if (feature.equals(nameVersion[0])) {
      317 if (f == null || f.getVersion().compareTo(featuresMap.get(key).getVersion()) < 0)

      { 318 f = featuresMap.get(key); 319 }

      320 }
      321 }

      I have an example, which adds 2 features: cxf (2.7.10) and camel (2.12.2). Expected result: 2.7.10 CXF bundles in target/features-repo. Actual result: 2.7.7 CXF bundles - as transitive through Camel features descriptor.

      Attachments

        1. pom.xml
          3 kB
          Igor Lazebny

        Issue Links

          Activity

            People

              ffang Freeman Yue Fang
              ilazebny Igor Lazebny
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: