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

Versions are not cleaned anymore when creating version ranges

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.2.0.M1
    • None
    • karaf
    • None

    Description

      This was reproduced when creating a custom distribution which had the 'camel-core/2.20.0-SNAPSHOT' as a feature dependency. Below is the stacktrace:

      Caused by: java.lang.IllegalArgumentException: invalid version "2.20.0-SNAPSHOT": non-numeric "0-SNAPSHOT"
              at org.osgi.framework.Version.parseInt(Version.java:170)
              at org.osgi.framework.Version.<init>(Version.java:134)
              at org.apache.karaf.features.internal.service.FeatureReq.exactVersion(FeatureReq.java:173)
              at org.apache.karaf.features.internal.service.FeatureReq.range(FeatureReq.java:168)
              at org.apache.karaf.features.internal.service.FeatureReq.<init>(FeatureReq.java:74)
              at org.apache.karaf.profile.assembly.FeatureSelector.getMatching(FeatureSelector.java:77)
              at org.apache.karaf.profile.assembly.FeatureSelector.addFeatures(FeatureSelector.java:59)
              at org.apache.karaf.profile.assembly.FeatureSelector.addFeatures(FeatureSelector.java:66)
              at org.apache.karaf.profile.assembly.FeatureSelector.addFeatures(FeatureSelector.java:66)
              at org.apache.karaf.profile.assembly.FeatureSelector.getMatching(FeatureSelector.java:53)
              at org.apache.karaf.profile.assembly.Builder.bootStage(Builder.java:878)
              at org.apache.karaf.profile.assembly.Builder.doGenerateAssembly(Builder.java:673)
              at org.apache.karaf.profile.assembly.Builder.generateAssembly(Builder.java:446)
              at org.apache.karaf.tooling.AssemblyMojo.doExecute(AssemblyMojo.java:521)
              at org.apache.karaf.tooling.AssemblyMojo.execute(AssemblyMojo.java:277)
              ... 22 more
      Caused by: java.lang.NumberFormatException: For input string: "0-SNAPSHOT"
              at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
              at java.lang.Integer.parseInt(Integer.java:580)
              at java.lang.Integer.parseInt(Integer.java:615)
              at org.osgi.framework.Version.parseInt(Version.java:168)
              ... 36 more
      
      

      I think we were implicitly cleaning it before some refactoring.

      Thanks!

      Attachments

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              jpoth John Poth
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: