Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practice to use and distribute 3rd party jars in Eclipse plugins

What is best practice to use and distribute 3rd party jars?

Approach one:

  1. Keep these jars in lib folder with in the plugin (or outside)
  2. Add there reference in build path for compiler but exclude this jar from being embedded into plugin jar
  3. Distribute separately along with our plugins

Approach two:

  1. Turn jars into plugin?
  2. Add dependency
  3. Distribute as usual plugin

Approach three:

  1. Embed 3rd party jar in lib folder of plugin
  2. Export packages that are required by other plugins

Would 2nd approach save these libs from causing conflict with different versions of same libs, possibly installed by other plugins? because jar converted plugin would remain invisible for the plugins that do not have dependency on it. Am I correct?

This type of questions have been discussed a lot but I could not find some satisfactory answer. I will appreciate if somebody posts a such link

like image 939
WSK Avatar asked Nov 14 '22 04:11

WSK


1 Answers

I prefer to approach two and three.

Eclipse projects always use solution two, packaging the third party libraries as separated bundles, such as ant, junit 3.x, junit 4.x and so on.

If your project is big and hope most flexible, I suggest you using approach two.

Approach three is more easy and fast for small project.

like image 50
Kane Avatar answered Dec 21 '22 00:12

Kane