Hi Eric, Lewis, Eric schrieb: > Hi > > I'm one of the persons responsible for the build in our company. > Frankly, I don't have a clue about OSGI, because I'm on the server side > of things (and we use JEE).
Just as a side note: OSGi is not restricted to the client side. In fact with Apache Sling we are very successfully using OSGi on the server side. > However, the idea is that the server part offers some APIs; every API > resides in a Maven project, whose artifact can be used by some other > plain Java class or by Eclipse (we use RCP for our client). > > So, after a client team member showed me that an OSGI bundle just > differs by the content of its MANIFEST.MF, I looked around and found > your excellent Felix plugin. > > However, I see a problem which I can't resolve with my limited > knowledge. > > Let's say my API uses other libraries, like Commons Lang. The default > way that Felix offers is to include all Maven dependencies as JARs in > the bundle JAR. This works, but I don't see the point in having the same > JAR over and over again in separate bundles. Maybe someone can explain > this to me. This is AFACT not the default. The default is defined Import-Package statements for the dependent library packages. These imports will then have to be resolved by appropriate exports in the OSGi framework. So for example if you deploy a bundleized Commons Lang library (IIRC the Apache Commons project will release new versions with appropriate bundle headers out of the box), that bundle will export the lang packages, which will be used by your bundle. You may of course decide to include your dependencies (or some of them) into your bundle and not import it from the framework. This depends a bit on the use case. But in the case of your API bundle, it is probably more appropriate to just Import-Package the dependencies. > > So, we're looking for an alternative, which is to have the Maven > dependencies point to the OSGI bundles which SpringSource offers. > > For instance: > <dependencies> > <dependency> > <groupId>org.apache.commons</groupId> > <artifactId>com.springsource.org.apache.commons.lang</artifactId> > <version>2.4.0</version> > </dependency> > </dependencies> > > > The idea is that all these bundles are then downloaded to some place and > that (in my example) the API just uses the Require-Bundle to state its > dependencies. However, I have no idea how to do this with the Felix > plugin. Is it possible at all? Does it make sense at all? You should not use Require-Bundle. See [1] for an excellent description, why. Rather let the maven-bundle-plugin generate the required Import-Package headers for you and let the OSGi framework resolve the dependencies. Hope this helps. Regards Felix [1] http://www.aqute.biz/Blog/2006-04-29 > > As I said, I'm new to all of this, and maybe my ideas are completely > weird :-) > > But any help is greatly appreciated! > > Best regards, > Eric > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

