13

My eclipse plug-in must be unpacked.

How can I enforce the installer to unpack it?

Will it be unpacked if the jar file is simply dropped into the plugins folder?

Lii
  • 11,553
  • 8
  • 64
  • 88
user101725
  • 133
  • 1
  • 4
  • why does it need to be unpacked? (if you're opening files at runtime, you can use getResourceAsStream() to open files in the jar) – Scott Stanchfield Jun 01 '09 at 15:56
  • @ScottStanchfield That doesn't really work. There are many things that require references to full paths as strings. getResourceAsStream is only useful once in a while. – James Moore Feb 02 '12 at 01:13
  • I agree. getResourceAsStream() doesn't help things like a SWT web browser, which I ran into today, as a matter of fact. – KevinL Sep 30 '14 at 02:17

2 Answers2

10

This can be chosen when configuring the feature including the plugin. Go to the plugin list, select your plugin and check "Unpack the plug-in archive after installation".

Arguably, this property should be defined by the plugin itself. There's a bug report about that https://bugs.eclipse.org/bugs/show_bug.cgi?id=157562

regards, Vlad

Vlad Dumitrescu
  • 931
  • 5
  • 11
  • 1
    This seems to no longer work. My plug-in code is packaged as a jar file even with this setting. I also tried "Eclipse-BundleShape: dir" in the plug-in manifest, and omitting that directive. The unpack setting in feature.xml is not respected when exporting a deployable feature from the UI. – MidnightJava Mar 03 '16 at 15:24
  • It works properly. The plug-in I was building did not have the bin/ dir specified in build.properties – MidnightJava Mar 03 '16 at 16:41
  • @MidnightJava: I wonder, why would `bin` dir in the `build.properties` file matter for the plug-in to be unpacked? Do you know this? – Lii Feb 01 '17 at 13:00
9

You can set the Eclipse-BundleShape value in your MANIFEST.MF file to either jar (the default) or dir. If set to dir, it is deploy unpacked.

Eclipse-BundleShape: dir

http://eclipsesource.com/blogs/2009/01/20/tip-eclipse-bundleshape

Joseph Jaquinta
  • 2,118
  • 17
  • 15