On 03/08/07, Arash Amiri <[EMAIL PROTECTED]> wrote:
> Hi
>
> I cant figure out how or where to add third party libraries to my
> maven-bundle-plugin.
>
> for example, I want to add the org.apache.commons.httpclient library to
> my bundle and want to use classes of this library in my bundle. how do I
> do that?

if you're expecting another bundle to provide the httpclient classes then
add it as a provided dependency to your bundle's pom - the classes will
be available on the classpath during compilation and the bundle plugin
will use BND to add the necessary OSGi import metadata to the Jar.

if you want to include the httpclient classes inside your bundle then you
can either embed the jar (bit complicated - see how the pax-plugin does
this, or wait for FELIX-308) or ask BND to add the classes like so:

   <Export-Package>org.apache.commons.httpclient.*</Export-Package>

or if you want to keep them private to your bundle:

   <Private-Package>org.apache.commons.httpclient.*</Private-Package>

and BND will pull the classes from the httpclient jar on the classpath and
add them to your bundle (note: you may need to add more packages to
pull in classes that httpclient depends on).

there's several examples given at:

   http://cwiki.apache.org/FELIX/maven-bundle-plugin-bnd.html

another good source of inspiration is Peter's BND page at:

   http://www.aqute.biz/Code/Bnd

if you get stuck, send an email and attach your pom and I'll take a look.

>
> greetings, arash
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Cheers, Stuart

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to