On 2 February 2010 04:00, Ching, Craig <[email protected]> wrote:

> Hi all,
>
> You could probably say this is off-topic for this list and more of a BND
> issue, but I know that there is a lot of BND knowledge here and I want to
> mimic what the maven bundle plugin does with pure BND as much as I can.  I
> need the functionality of maven bundle plugin's "Embed-Dependency"
> configuration, I want my jars to be embedded (inline=false), not inlined.
>  From reading the code, it appears that embed-dependency is turned into
> include-resource and bundle-classpath BND directives.  But when I do this:
>
> -classpath=com.ibm.mq.jar,connector.jar
> Include-Resource=com.ibm.mq.jar,connector.jar
> Bundle-Classpath=.,com.ibm.mq.jar,connector.jar
> Private-Package=!*
>
> BND doesn't seem to pull the Export-Package from the packages in the
> embedded jars.  Is this something that can be accomplished by BND alone?  Or
> is this where the maven bundle plugin did some "value add" if you will?  And
> if the latter, what was done?  I appreciate any help!
>

The Embed-Dependency instruction is specific to the maven-bundle-plugin
because
the Bnd Tool does not know anything about Maven or its artifact dependency
graph.

Think of it as a pre-processor step: the bundleplugin takes the
Embed-Dependency
instruction along with the dependencies from Maven and generates the
appropriate
general-purpose Include-Resource and Bundle-ClassPath entries used by Bnd.

The code to do this is in its own file and should be straightforward to
follow:


http://svn.apache.org/repos/asf/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java

But note that if you're running this outside of Maven you'll have to find
some way
to pass in the dependency list (either that or use Maven in an embedded
form).

HTH


> P.S. In case it's not clear, I am trying to "wrap" some jars into a bundle
> when our package is installed on the target machine.  We aren't allowed to
> redistribute the jar files in this case, so we want to turn them into a
> bundle before use.
>
> Cheers,
> Craig
>

-- 
Cheers, Stuart

Reply via email to