What is best practice to use and distribute 3rd party jars?
Approach one:
- Keep these jars in lib folder with in the plugin (or outside)
- Add there reference in build path for compiler but exclude this jar from being embedded into plugin jar
- Distribute separately along with our plugins
Approach two:
- Turn jars into plugin?
- Add dependency
- Distribute as usual plugin
Approach three:
- Embed 3rd party jar in lib folder of plugin
- 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
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.