You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by smunro <st...@gmail.com> on 2017/12/09 21:52:06 UTC

Conditional-Package

Hello,

I am investigating the "Conditional-Package" instruction for OSGI bundles
via the MVN bundle plugin. It was brought to my attention by another member
of my team, who cannot find any documentation on this instruction. 

I was wondering if anyone could comment on this feature and its typical use
case. Alternatively, if you could point me in the right direction of an
example bundle which uses this and/or documentation. 

I suspect this is not heavily used in OSGI apps, as I've only seen it
mentioned in posts from people with specific desires to deploy a bundle IF
certain dependencies are already in place in the deployment environment, yet
I've never seen a code example or a "here is an example of how to use it via
the maven bundle plugin".

Stephen



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Conditional-Package

Posted by Massimo Bono <ma...@gmail.com>.
Hello Stephen,

I investigated that bnd entry too. For me the following 2 resources were
really helpful:

- http://njbartlett.name/2014/05/26/static-linking.html;
-
https://stackoverflow.com/questions/39494328/how-useful-is-to-create-an-osgi-utility-bundle
;

Maybe there might be useful for you too.

As for "here an example of how to use them in maven-bundle plugin, it's the
same as in bnd: you need to add "Conditional-Package" entry in the
configuration and add whatever pacakge you want to statically include in
the bundle. As Bartlett specified in one of the 2 resoruces I've linked
you, Conditional-Pacakge is useful for when "the implementation is the
contract of your bundle" (e.g. utility classes).


2017-12-10 12:18 GMT+01:00 smunro <st...@gmail.com>:

> Hello Peter,
>
> Thanks for the quick reply.  I came across this page indirectly that
> commented on the instruction, but I only noticed the header section.
>
> I tinkered with this locally and it seems to work as expected. I am still
> very curious why conditional-package isn't covered as well as all the other
> plugin instructions. Perhaps , as you say, its an isolated incident where
> it
> simply didn't have enough TLC, but at the same time It made be question how
> useful the instruction was.
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>



-- 
*Ing. Massimo Bono*

Re: Conditional-Package

Posted by smunro <st...@gmail.com>.
Hello Peter,

Thanks for the quick reply.  I came across this page indirectly that
commented on the instruction, but I only noticed the header section.

I tinkered with this locally and it seems to work as expected. I am still
very curious why conditional-package isn't covered as well as all the other
plugin instructions. Perhaps , as you say, its an isolated incident where it
simply didn't have enough TLC, but at the same time It made be question how
useful the instruction was.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Conditional-Package

Posted by Peter Kriens <pe...@aqute.biz>.
Although bnd documentation could use some tender loving care this is an unfortunately rare example that is documented at the appropriate place:

	http://bnd.bndtools.org/instructions/conditional-package.html <http://bnd.bndtools.org/instructions/conditional-package.html>

It does light up as the first line on a Google search for `bnd Conditional Package`

Kind regards,

	Peter Kriens

> On 9 Dec 2017, at 22:52, smunro <st...@gmail.com> wrote:
> 
> Hello,
> 
> I am investigating the "Conditional-Package" instruction for OSGI bundles
> via the MVN bundle plugin. It was brought to my attention by another member
> of my team, who cannot find any documentation on this instruction. 
> 
> I was wondering if anyone could comment on this feature and its typical use
> case. Alternatively, if you could point me in the right direction of an
> example bundle which uses this and/or documentation. 
> 
> I suspect this is not heavily used in OSGI apps, as I've only seen it
> mentioned in posts from people with specific desires to deploy a bundle IF
> certain dependencies are already in place in the deployment environment, yet
> I've never seen a code example or a "here is an example of how to use it via
> the maven bundle plugin".
> 
> Stephen
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html