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

karaf-maven-plugin assembly goal fails to find nested features with explicit version containing qualifier

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • 4.0.5, 4.0.6
    • 4.2.0.M2
    • karaf
    • None

    Description

      In karaf 4.0.5 and 4.0.6 (at least) there is an issue with nested features which explicitly declare a version when that version has a qualifier e.g., such as development snapshot version like 1.0-SNAPSHOT or a release qualifier like for example 1.0.0-RELEASE.

      For example, take our features descriptor for a simple project:

          <feature name="api" version="${project.version}">
              <bundle>mvn:org.deklanowski.karaf/api/${project.version}</bundle>
          </feature>
      
          <feature name="impl" version="${project.version}">
              <feature version="${project.version}">api</feature> 
              <!--feature>api</feature-->
              <bundle>mvn:org.deklanowski.karaf/impl/${project.version}</bundle>
          </feature>
      

      If we explicitly include the version of the nested api feature inside the impl feature then
      you will get the following output when building the assembly:

      [INFO] Reactor Summary:
      [INFO] 
      [INFO] sample feature ..................................... SUCCESS [  0.116 s]
      [INFO] sample karaf feature repository .................... SUCCESS [  0.763 s]
      [INFO] sample karaf assembly configuration ................ FAILURE [  2.727 s]
      [INFO] sample feature api ................................. SKIPPED
      [INFO] sample feature impl ................................ SKIPPED
      [INFO] sample assembly reactor ............................ SKIPPED
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 5.178 s
      [INFO] Finished at: 2016-08-30T10:52:02+01:00
      [INFO] Final Memory: 23M/399M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.6:assembly (default-assembly) on project assembly: Unable to build assembly: Could not find matching feature for api/1.0-SNAPSHOT -> 

      Excluding the version number solves the issue. As stated this is not limited to snapshot qualifiers, any qualifier of the form

      '-<qualifier>'

      seems to do it.

      Debugging the assembly yields the problem emanating from the recursive addFeatures method in the karaf assembly building subsystem Builder.java.

      Please see my sample project and debug screenshots in sample-karaf-assembly

      Attachments

        Issue Links

          Activity

            People

              ggrzybek Grzegorz Grzybek
              declancox Declan Cox
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: