1

My Eclipse plugin needs to be executed unfolded as a flat directory (it uses JNI, and the JNI part needs access to some files provided by the plugin). Is it possible to configure the plugin to be automatically unfolded if installed as a jar ?. Or my only option is to ask the user to unzip its contents in the Eclipse dropins folder?

In case there is no way to unfold a plugin jar automatically, is it possible to build an update site configured to install the plugin in the dropins folder and copying it unfolded ?

Sergio
  • 8,532
  • 11
  • 52
  • 94

3 Answers3

2

If you package your plugin(s) as a feature then you can specify this behavior in Feature manifest editor.

Martti Käärik
  • 3,601
  • 18
  • 28
2

The most common way to do this is to use org.osgi.framework.Bundle.getEntry(String) and then org.eclipse.core.runtime.FileLocator.toFileURL(URL). getEntry("/jni_lib/") will return a URL that points to a folder, and FileLocator will expand the requested bundle URL to the local disk if necessary. This works if you use features or not, if the plugins on disk are exported or not, etc.

@vanaprogeja proposed the second most common option, and needs features to work (which is perfectly acceptable)

Paul Webster
  • 10,614
  • 1
  • 25
  • 32
1

You can check the unpack option while you are creating Feature project for your plugin project.

Eshika
  • 321
  • 1
  • 8
  • 20