You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Bruce Edge <br...@nextissuemedia.com> on 2014/11/19 01:39:15 UTC

including transitive dependencies in sling bundles

What is the preferred way to include a bundle's transitive dependencies in the jar that is deployed to the OGSI service?

I read  some info on dropping the dependent jars in the WebDAV <jct root>/libs. Is there some option to mount this at start time, or does one have to use POST to push deps into the JCR?
I'm concerned with the packaging requirements for target systems. My app packages do depend on sling, but it seems overly brittle to require that sling be running at install time in order to populate transitive dependencies.

My preference would be to include them in the jar that I deploy to sling. I know I can use maven-dependency-plugin to populate a folder with my transitves, but I'm not sure how to package this up so that the OSGI deployment works.

-Bruce

Re: including transitive dependencies in sling bundles

Posted by Sarwar Bhuiyan <sa...@gmail.com>.
Look at the maven-sling-plugin with embed-dependency element in
configuration. You can define which dependencies you want to embed in the
bundle.
On Wed, 19 Nov 2014 at 00:39 Bruce Edge <br...@nextissuemedia.com>
wrote:

> What is the preferred way to include a bundle's transitive dependencies in
> the jar that is deployed to the OGSI service?
>
> I read  some info on dropping the dependent jars in the WebDAV <jct
> root>/libs. Is there some option to mount this at start time, or does one
> have to use POST to push deps into the JCR?
> I'm concerned with the packaging requirements for target systems. My app
> packages do depend on sling, but it seems overly brittle to require that
> sling be running at install time in order to populate transitive
> dependencies.
>
> My preference would be to include them in the jar that I deploy to sling.
> I know I can use maven-dependency-plugin to populate a folder with my
> transitves, but I'm not sure how to package this up so that the OSGI
> deployment works.
>
> -Bruce
>

Re: including transitive dependencies in sling bundles

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Wed, Nov 19, 2014 at 1:39 AM, Bruce Edge
<br...@nextissuemedia.com> wrote:
> ...What is the preferred way to include a bundle's transitive
> dependencies in the jar that is deployed to the OGSI service?...

The preferred way is not to embed them but rather deploy them as
separate bundles.

IMO embedding only makes sense if those transitive dependencies are
only useful for that single bundle, or need to be hidden in there for
usually ugly reasons.

If you need to wrap existing non-OSGi libraries as bundles there's an
example at samples/mail-archive/james-wrapper/pom.xml - which does use
embed-dependency but to create a distinct bundle with just the wrapped
stuff.

-Bertrand