You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Martin Lichtin <li...@yahoo.com> on 2015/03/09 12:45:45 UTC

How does work in feature files

Inside Karaf's "standard" feature descriptor, there is 

<conditional> 
    <condition>webconsole</condition> 
    <bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.instance/3.0.3</bundle> 
    <bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.features/3.0.3</bundle> 
    <bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.gogo/3.0.3</bundle> 
    <bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.http/3.0.3</bundle> 
</conditional> 


I can't find any documentation on the <conditional> tag. Is <condition> containing a feature name?

Also I'm puzzled how this entry will affect the situation when I later on do a "feature:install webconsole".

And could these 4 bundles not just be listed as part of the "webconsole" feature description?

Thanks
- Martin

Re: How does work in feature files

Posted by Basic Danijel <da...@gmail.com>.
Hi Martin,

Could the info on this page https://issues.apache.org/jira/browse/KARAF-1718
help you a little bit?

Regards,
Danijel

On Mon, Mar 9, 2015 at 12:45 PM, Martin Lichtin <li...@yahoo.com> wrote:

> Inside Karaf's "standard" feature descriptor, there is
>
> <conditional>
>     <condition>webconsole</condition>
>     <bundle
> start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.instance/3.0.3</bundle>
>     <bundle
> start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.features/3.0.3</bundle>
>     <bundle
> start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.gogo/3.0.3</bundle>
>     <bundle
> start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.http/3.0.3</bundle>
> </conditional>
>
>
> I can't find any documentation on the <conditional> tag. Is <condition>
> containing a feature name?
>
> Also I'm puzzled how this entry will affect the situation when I later on
> do a "feature:install webconsole".
>
> And could these 4 bundles not just be listed as part of the "webconsole"
> feature description?
>
> Thanks
> - Martin
>

Re: How does work in feature files

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Martin,

It means that:
1/ if the webconsole feature is installed, the bundles will be installed
2/ when the webconsole feature will be installed, the bundles will be 
installed

The <condition/> contains a feature name but I created Jira to enhance 
it: for instance, in order to allow feature_name/version_range pattern.

Regards
JB

On 03/09/2015 12:45 PM, Martin Lichtin wrote:
> Inside Karaf's "standard" feature descriptor, there is
>
> <conditional>
>      <condition>webconsole</condition>
>      <bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.instance/3.0.3</bundle>
>      <bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.features/3.0.3</bundle>
>      <bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.gogo/3.0.3</bundle>
>      <bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.http/3.0.3</bundle>
> </conditional>
>
>
> I can't find any documentation on the <conditional> tag. Is <condition> containing a feature name?
>
> Also I'm puzzled how this entry will affect the situation when I later on do a "feature:install webconsole".
>
> And could these 4 bundles not just be listed as part of the "webconsole" feature description?
>
> Thanks
> - Martin
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: How does work in feature files

Posted by Martin Lichtin <li...@yahoo.com>.
Thanks for the info and yes, the JIRA helped a bit :)


I ran into it while debugging an issue with the karaf-maven-plugin.
It seems to not really handle conditionals.


Eg:
    <descriptors>
       								<descriptor>mvn:org.apache.karaf.features/spring/3.0.3/xml/features</descriptor>
       								<descriptor>mvn:org.apache.karaf.features/standard/3.0.3/xml/features</descriptor>
       								<descriptor>mvn:org.apache.karaf.features/enterprise/3.0.3/xml/features</descriptor>
    </descriptors>
    <features>
       								<feature>webconsole</feature>
        ...


karaf-maven-plugin does not include the bundles that are inside the "webconsole" conditional of "standard".
(For "features-add-to-repository" for example.)

Martin

>________________________________
> From: Achim Nierbeck <bc...@googlemail.com>
>To: "user@karaf.apache.org" <us...@karaf.apache.org>; Martin Lichtin <li...@yahoo.com> 
>Sent: Monday, March 9, 2015 1:17 PM
>Subject: Re: How does <conditional> work in feature files
> 
>
>
>Conditional means, this part is conditionally installed in case the webconsole is already installed or in case the webconsole is just installed those bundles are also installed. This is for better seperation of concerns and meant as a trigger. 
>You'll see a lot of conditionals in the current master standard feature. 
>
>
>regards, Achim 
>
>
>P.S. in case your missing documentation, look at the jira :-)
>
>
>2015-03-09 12:45 GMT+01:00 Martin Lichtin <li...@yahoo.com>:
>
>
>
>
>Inside Karaf's "standard" feature descriptor, there is
>>
>><conditional>
>>    <condition>webconsole</condition>
>>    <bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.instance/3.0.3</bundle>
>>    <bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.features/3.0.3</bundle>
>>    <bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.gogo/3.0.3</bundle>
>>    <bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.http/3.0.3</bundle>
>></conditional>
>>
>>
>>I can't find any documentation on the <conditional> tag. Is <condition> containing a feature name?
>>
>>Also I'm puzzled how this entry will affect the situation when I later on do a "feature:install webconsole".
>>
>>And could these 4 bundles not just be listed as part of the "webconsole" feature description?
>>
>>Thanks
>>- Martin
>>
>
>
>
>-- 
>
>
>Apache Member
>
>Apache Karaf <http://karaf.apache.org/> Committer & PMC
>OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
>blog <http://notizblog.nierbeck.de/>
>Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
>
>Software Architect / Project Manager / Scrum Master 
>
>
>
>

Re: How does work in feature files

Posted by Achim Nierbeck <bc...@googlemail.com>.
Conditional means, this part is conditionally installed in case the
webconsole is already installed or in case the webconsole is just installed
those bundles are also installed. This is for better seperation of concerns
and meant as a trigger.
You'll see a lot of conditionals in the current master standard feature.

regards, Achim

P.S. in case your missing documentation, look at the jira :-)

2015-03-09 12:45 GMT+01:00 Martin Lichtin <li...@yahoo.com>:

> Inside Karaf's "standard" feature descriptor, there is
>
> <conditional>
>     <condition>webconsole</condition>
>     <bundle
> start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.instance/3.0.3</bundle>
>     <bundle
> start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.features/3.0.3</bundle>
>     <bundle
> start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.gogo/3.0.3</bundle>
>     <bundle
> start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.http/3.0.3</bundle>
> </conditional>
>
>
> I can't find any documentation on the <conditional> tag. Is <condition>
> containing a feature name?
>
> Also I'm puzzled how this entry will affect the situation when I later on
> do a "feature:install webconsole".
>
> And could these 4 bundles not just be listed as part of the "webconsole"
> feature description?
>
> Thanks
> - Martin
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master