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

features-create-kar goal of the karaf-maven-plugin ignores bundles listed in the features that have the "dependency" property set to "true"

    XMLWordPrintableJSON

Details

    Description

      Use case :

      I'm using the 'karaf-assembly' goal of the karaf-maven-plugin to create a "standalone" karaf distribution with all required dependencies stored in the system repo.

      Note: the karaf-assembly-goal depends on the features-create-kar goal which is where the resolving of the feature is performed.

      When the "scr" feature was added to the list of features to be installed only the event admin and SCR command-line bundles got added to the assembly's system repo and not the SCR runtime.

      Looking at the Karaf features file (below) the "missing" dependencies have the "dependency" property set to "true". If I understand correctly, this flag marks the artifact's capabilities to be resolved from an OBR.

      <features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="standard-3.0.0-SNAPSHOT">
      <repository>mvn:org.ops4j.pax.web/pax-web-features/3.0.1/xml/features</repository>
      ...
      <feature name="scr" version="3.0.0-SNAPSHOT" description="Declarative Service support" resolver="(obr)">
      <feature>eventadmin</feature>
      <bundle start-level="30" dependency="true">mvn:org.apache.felix/org.apache.felix.metatype/1.0.6</bundle>
      <bundle start-level="30" dependency="true">mvn:org.apache.felix/org.apache.felix.scr/1.6.2</bundle>
      <bundle start-level="30">mvn:org.apache.karaf.scr/org.apache.karaf.scr.command/3.0.0-SNAPSHOT</bundle>
      <conditional>
      <condition>management</condition>
      <bundle start-level="30">mvn:org.apache.karaf.scr/org.apache.karaf.scr.management/3.0.0-SNAPSHOT</bundle>
      </conditional>
      <conditional>
      <condition>webconsole</condition>
      <bundle start-level="30">mvn:org.apache.felix/org.apache.felix.webconsole.plugins.ds/1.0.0</bundle>
      </conditional>
      </feature>
      ...
      </features>

      For me there are (at least) three options to resolve this issue.

      1. Issue a warning that the feature has not be completely installed.
      2. Add a flag to the features-create-kar goal to ignore the "dependency" flag.
      3. Add some (undefined) OBR resolving capability to fetch the "best" bundle.

      I've successfully tested option 2 and can submit a patch if someone can suggest what the plugin parameter should be called.

      Attachments

        Issue Links

          Activity

            People

              jbonofre Jean-Baptiste Onofré
              nick.smith@techopfinance.com Nick Smith
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: