felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henry Saginor <hsagi...@gmail.com>
Subject Re: Is it possible to "shade" non-OSGi projects into bundle?
Date Wed, 08 Oct 2014 19:26:58 GMT
Hi Jens,

You can add non-OSGi dependencies as embedded dependencies to your project using maven-bundle-plugin
[1] via Embed-Dependency. In this case the embedded dependency will be added to your bundles
jar and to Bundle-ClassPath in it’s manifest.
This should also avoid other class loader issues you mentioned. It will not export any packages
from the dependency unless you explicitly specify them.

Hope this helps.


[1]  http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
On Oct 8, 2014, at 9:39 AM, Rabe, Jens <jens.rabe@iwes.fraunhofer.de> wrote:

> Hello,
> I want to create a self-contained OSGi bundle which uses some Spring/JPA features like
the auto generated repositories (PagingAndSortingRepository). I configured my pom.xml as a
bundle, and it builds correctly. The problem is though, non-Maven dependencies like the Spring
stuff cannot easily be incorporated into an OSGi runtime. There are functions like Karaf's
wrap which works well (converts non-OSGi bundles to OSGi on the fly), but that causes all
sorts of stuff to be exported and causing problems like multiple dependency chains resolving
to a single package.
> In Eclipse using Equinox in the pre-Maven days, I always did the following:
> - I created a "lib" folder in my project
> - copied all non-OSGi dependencies there
> - adjusted the build.properties to include them
> - set the Bundle-Classpath to include these jars
> This worked fine. Is it somehow possible to do this with maven-shade-plugin as well?
> Any help would be greatly appreciated,
> Jens

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message