Nick Smith created KARAF-2357:
---------------------------------
Summary: features-create-kar goal of the karaf-maven-plugin
ignores bundles listed in the features that have the "dependency" property set
to "true"
Key: KARAF-2357
URL: https://issues.apache.org/jira/browse/KARAF-2357
Project: Karaf
Issue Type: Bug
Components: karaf-tooling
Affects Versions: 3.0.0
Reporter: Nick Smith
Priority: Minor
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.
# Issue a warning that the feature has not be completely installed.
# Add a flag to the features-create-kar goal to ignore the "dependency" flag.
# 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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira