Conditional-Package

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Conditional-Package

smunro
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
Reply | Threaded
Open this post in threaded view
|

Re: Conditional-Package

Peter Kriens
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

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 <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: Conditional-Package

smunro
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
Reply | Threaded
Open this post in threaded view
|

Re: Conditional-Package

Massimo Bono
Hello Stephen,

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


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 <[hidden email]>:
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.



--
Ing. Massimo Bono