Making External Libraries available as an Eclipse Plug-in March 8, 2007Posted by shahan in eclipse plugin.
Sometimes it’s desirable to maintain the library code separately from the plug-in being developed. Converting the library to a plug-in won’t change its structure and there is minimal maintenance required. To go through the conversion, follow these steps:
1. right-click on the project representing the library and in the context menu proceed to “PDE-Tools” and select “Convert Project to Plug-in Projects…
It’s that easy. The plugin is automatically exported when running/debugging an Eclipse instance during plug-in development.
If your library itself relies on jar files, those will have to be included in the manifest file.This will also give you access to some of the features you allow to be exposed to other plug-ins dependent on your library plug-in. In the manifest file:
– in the runtime tab, add the external jar files to your plug-in classpath
– in the runtime tab, select the packages that you would like other plug-ins to have access to, preferrably your library packages at the minimum and optionally the external library packages that your library itself uses.
– in the overview tab you can rename your plug-in and apply versioning
Once the plug-in is configured as desired, simply include this plug-in in the dependency tab of the other plug-in’s manifest file and you’ll have access to your library plug-ins exported packages.