Best practices for using and distributing third-party jars in Eclipse plugins

What is the best way to use and distribute third-party banks?

Approach one:

  • Store these jars in the lib folder in the plugin (or outside)
  • Add a link there to the build path for the compiler, but exclude this jar from the jar built into the plugin
  • Distribute separately with our plugins

Go to two:

  • Insert banners into the plugin?
  • Add Dependency
  • Distribute the plugin as usual

We approach three:

  • Insert third-party banner into the lib folder from the plugin
  • Export packages required by other plugins

Will the second approach keep these libs in conflict with different versions of the same libraries, possibly installed by other plugins? because the converted jar plugin will remain invisible to plugins that are not dependent on it. I'm right?

This type of question has been discussed a lot, but I could not find a satisfactory answer. I would appreciate if someone posted such a link

+4
source share
1 answer

I prefer to approach two and three.

Eclipse projects always use solution two, packaging third-party libraries as separate packages, such as ant, junit 3.x, junit 4.x, etc.

If your project is large and reliable, the most flexible, I suggest you use two approaches.

Approaching three is easier and faster for a small project.

+1
source

Source: https://habr.com/ru/post/1335205/


All Articles