I am working on an Eclipse plugin that has several components. Previously this was a single plugin and everything worked great. However, I recently broke this into multiple plugins that are part of a single feature.
The structure is there are a whole bunch of plugins in the feature. There is one "core" plugin that contains common code and libraries. Every other plugin relies on the core plugin.
The problem is while the plugins compile fine and there are no warnings regarding the plugin.xml, manifest, etc., the plugins do not work at runtime due to missing classes. Specifically, I have Google Guava in the core plugin and the classes in the Guava jar cannot be found at runtime. There are other jars but this is the first one to blow up.
I have tried several ways to resolve this:
The only way that actually works is to create a library plugin which essentially unpacks and merges all of the jar files. The problem here is I then have a mishmash of random files. If I want to upgrade a jar file, it is tedious to regenerate the project and I suspect would be clear as mud when searching through SVN history for the project.
Is there another way to accomplish this that makes it easy to drop in updated jar files and have it work with minimal changes?
Exporting packages contained in the Guava jar in the core project has the same results: does not work.
Have your wondered on this?
As far as I am aware, In Eclipse Equinox is OSGi container and in OSGi we have the facility of using other bundles resources.
So, here make sure that you are exporting the right things from the right place.
Probably, the other bundles are not able to recognize the classes exported from core bundle (check import-package here in all your child bundles) OR something miss-happenings in classloaders.
Try using "Eclipse-Buddy policy" attribute in manifest. It may work :-)
Something that I do and work is:
Notes:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.