jump to navigation

Making External Libraries available as an Eclipse Plug-in March 8, 2007

Posted by shahan in eclipse plugin.
trackback

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.

Comments»

1. Paul - February 5, 2009

Thank you! This was driving me insane.

2. Keith - March 20, 2009

This was extremely helpful! I could not figure out what the problem was at first, but this solved it for me. Thanks

3. Guicy Mocks in Eclipse RCP - November 24, 2010

[…] this short introduction of Guice, it is time to package this 3rd-party library into the Eclipse RCP client. In fact it is all about putting the JARs (guice-2.0.jar, aopalliance-1.0.jar) into some folder […]


Leave a comment