|non-osgi jars: embedded in bundle or in plugin directory? [message #512165]
||Thu, 04 February 2010 09:33
| Henno Vermeulen
Registered: July 2009
We created a core system which makes use of 74 external jar libraries which we want to use in Eclipse RCP. It is not GUI specific.|
We would like to start with the "one big bundle" approach of getting this core system to work, instead of having to OSGi-ify our core system and find OSGi bundles for our dependencies. (Later we should probably remove unneeded external dependencies and OSGI-ify our own system)
We can use Maven (with the bundle plugin) to create an OSGi bundle.
I already have successfully done this, but when I tell it to unpack all external jars before creating the bundle, the bundle jar will be in a big mess: resource files for different specific jars get into the root directory of the bundle and for example many LICENSE.TXT files are dropped because there can be only one such file.
The other option is to embed the jars inside the bundle (jars within a jar), which gives a very clean bundle jar. (Disadvantage: not usable outside of OSGi). This also seems to work, until the code in our own Eclipse plugin explicitly need access to a class from an embedded jar. Although this class is exported by the bundle and the jar is on the bundle classpath, the Eclipse compiler tells it can not find the class! Shouldn't this be supported by OSGi?
Am I doing something wrong here, or is this the usual behavior?
The last and probably currently best approach I can think of is to create a bundle which does not contain the jars but uses a "lib" directory for the external jars. Is this an official OSGi way? Or would this automatically mean we have to turn it into an Eclipse Plugin which can only be used by Eclipse? In this case, do we need to have a plugin.xml file?
[Updated on: Thu, 04 February 2010 09:36]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.16912 seconds