views:

280

answers:

2

Hi,

It has been a frustrating day trying to package multiple plugins and their property files into an executable jar.

How to I package these plugins into a single jar, leaving the properties files outside:
- pluginA with pluginA.properties
- pluginB with pluginB.properties
- pluginC that requires pluginA and pluginB

The property files are accessible from within their relevant plugin, e.g. pluginA.properties is accessible from pluginA.
However, the properties files are not accessible from pluginC.

Can someone please help?

Thanks :)

A: 

Not sure to understand your problem. Do you have the jar classpath (in META file) containing the folder where your property files are stored ?

g andrieu
You can not export 3 plugins into 1 jar! Every plugin will be a single jar.
Markus Lausberg
A: 

When pluginA should use classes frmo pluginB, pluginA has to put the package path to the runtime packages. You can find the configuration in MANIFEST->Runtime->"Exported Packages"

When you want to use properties files, you have to use the bundle of the called plugin, to find the right properties file. Try to get the in pluginC the default plugin implementation of pluginA

AbstractUIPlugin.getDefault()

Than search for the bundle object and use the findResource method to find the properties file.

Another way is to write a Utility class in pluginA that gives you the property value for a specific key. This class you can call from every plugin you want.

You can test your jars in Eclipse by calling

Export -> Deployable plug-ins and fragments

Than you can check if the export works and all files are inside the jar. If not, you have to update your MANIFEST or build.properties file

Markus Lausberg