简体   繁体   中英

Eclipse plugins as folders rather than jars

In eclipse tree or any eclipse based application. I can see that inside the plugins folder. most of plugins are in the jar format while some of them are in folders and this folder is just the jar extract .

why someone could do this ? what is the benefit of putting a plugin as extracted jar rather than only jar file ?

You can do this to embed jars in the plugin that are used in classpath because yo can have issues with nested jars in classpath.

I think that you can also access resources differently. And it can be an easy (and dirty?) way to allow some customizations by overriding some resources such as images.

Let's say a plugin will need to execute an embedded OS dependent script on its start-up (ex. ".bat" script). If this plugin is installed as a jar, it will need to :

  • get an InsputStream of the embedded script
  • ensure it can write it somewhere (temp folder usually)
  • run the script
  • at the next start-up; check that the script has not already been extracted
  • ...

Or, if this plugin is extracted as folder :

  • run the script.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM