You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by "jeremie.brebec@gmail.com" <je...@gmail.com> on 2017/06/29 12:55:13 UTC

Conditional Features and capabilities

Hi,

I have two features implementing the same capability (and I can only install one of both - For example a capability "database" and two features, "derby" and "H2").

I have also a third feature, "web-user-interface", and I want that, when this feature and the capability defined earler are installed, then another set of bundles are automatically installed.

The "conditional" in the features.xml seems to allow this kind of behavior, but it looks like I can only specified a feature as a dependency, and not a capability.

How can I implement this scenario with Karaf 4.1?

Regards,Jérémie

Re: Conditional Features and capabilities

Posted by "jeremie.brebec@gmail.com" <je...@gmail.com>.
Thanks !

On 2017-06-29 14:57 (+0200), Guillaume Nodet <gn...@apache.org> wrote: 
> Actually, requirements are supported in conditionals.
> You need to prepend "req:" in front of the requirement, see the following
> example:
> 
> https://github.com/apache/karaf/blob/master/assemblies/features/standard/src/main/feature/feature.xml#L267
> 
> Guillaume
> 
> 2017-06-29 14:55 GMT+02:00 jeremie.brebec@gmail.com <
> jeremie.brebec@gmail.com>:
> 
> > Hi,
> >
> > I have two features implementing the same capability (and I can only
> > install one of both - For example a capability "database" and two features,
> > "derby" and "H2").
> >
> > I have also a third feature, "web-user-interface", and I want that, when
> > this feature and the capability defined earler are installed, then another
> > set of bundles are automatically installed.
> >
> > The "conditional" in the features.xml seems to allow this kind of
> > behavior, but it looks like I can only specified a feature as a dependency,
> > and not a capability.
> >
> > How can I implement this scenario with Karaf 4.1?
> >
> > Regards,Jérémie
> >
> 
> 
> 
> -- 
> ------------------------
> Guillaume Nodet
> 

Re: Conditional Features and capabilities

Posted by Guillaume Nodet <gn...@apache.org>.
Actually, requirements are supported in conditionals.
You need to prepend "req:" in front of the requirement, see the following
example:

https://github.com/apache/karaf/blob/master/assemblies/features/standard/src/main/feature/feature.xml#L267

Guillaume

2017-06-29 14:55 GMT+02:00 jeremie.brebec@gmail.com <
jeremie.brebec@gmail.com>:

> Hi,
>
> I have two features implementing the same capability (and I can only
> install one of both - For example a capability "database" and two features,
> "derby" and "H2").
>
> I have also a third feature, "web-user-interface", and I want that, when
> this feature and the capability defined earler are installed, then another
> set of bundles are automatically installed.
>
> The "conditional" in the features.xml seems to allow this kind of
> behavior, but it looks like I can only specified a feature as a dependency,
> and not a capability.
>
> How can I implement this scenario with Karaf 4.1?
>
> Regards,Jérémie
>



-- 
------------------------
Guillaume Nodet