You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Arash Amiri <ar...@researchstudio.at> on 2007/08/03 12:17:12 UTC

maven-bundle-plugin and thrid party dependencies

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?

greetings, arash

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven-bundle-plugin and thrid party dependencies

Posted by Stuart McCulloch <st...@jayway.net>.
On 03/08/07, Arash Amiri <ar...@researchstudio.at> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Cheers, Stuart

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org