Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add 3rd party library to an eclipse plugin

What is the right way to include an additional JAR file in an Eclipse plugin? My own plugin requires apache-commons-io. I copied the JAR into my plugins directory and added it via the "Dependencies" tab of the plugin manifest. This works for me, but other users of my plugins will have to download Commons-IO manually.

What is the correct way to package Commons-IO in my plugin?

like image 454
theDmi Avatar asked Jul 01 '11 08:07

theDmi


2 Answers

I usually use the following strategy:

  • If I can find the JAR in question packaged as a bundle - i.e. the MANIFEST.MF contains the correct entries - then I use this. Have a look at the Orbit project for a set of pre-packaged bundles of all sorts. org.apache.commons.io is already here...
  • If that is not possible, then I just include the JAR in my bundle, and updates MANIFEST.MF - e.g. Bundle-ClassPath: library.jar,.
like image 152
Tonny Madsen Avatar answered Oct 29 '22 19:10

Tonny Madsen


Sometimes it is cleaner to create a unique plugin for libraries. (So you can use it from several plugins, License topics, Size of your Plug-In, different version, ...)

Do so by "New ..." Category: "Plug-In Development" then "Plug-In from existing jar archieve"

Select your jars and there you go.

like image 29
FlorianOver Avatar answered Oct 29 '22 17:10

FlorianOver