1

I have several Eclipse RCP applications in the same suite, whose executables are in the same directory. I'd like to have a different "plugins" directory for each.

Can I do this, and if so, how?

[I know that I could also put all the plugins into the same directory and specify version-specific dependencies, but this is a special case.]

Andy Thomas
  • 84,978
  • 11
  • 107
  • 151
  • Out of curiosity, what is the problem you are trying to solve? – Thorbjørn Ravn Andersen Aug 08 '13 at 21:02
  • Distribution of a suite of RCP applications in which some should remain unmodified, and others not. The older ones did not specify version dependencies for plugins. We're trying to minimize development cost and risk. Excellent question, by the way. – Andy Thomas Aug 08 '13 at 21:06

1 Answers1

2

I was able to get this to work after a few hours of reading, experimentation and head-banging. I couldn't find the answer in Stackoverflow; hopefully this will help the next person to look.

First, I restructured the directory containing my executables. A shared "plugins" directory had been alongside the executables. I made copies of it in application-specific subdirectories, and removed the original.

parent
   foo.exe
   foo.ini
   foo 
      configuration
         config.ini
      plugins
   bar.exe
   bar.ini
   bar
      configuration
         config.ini
      plugins

Next, I added settings similar to the following, to the top of each *.ini file, above -vmargs. [Your version numbers may vary.] An option and its argument are separated by line breaks.

-startup
foo/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
-install
foo 
--launcher.library 
foo/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120522-1813/eclipse_1503.dll

And this existing setting was already underneath -vmargs.

-Dosgi.sharedConfiguration.area=file:configuration

Note: although this works, the "configuration" directory and the -Dosgi.sharedConfiguration.area setting are anachronisms from a single -install directory. It would be more elegant to have config.ini alongside the plug-ins directory, and omit the setting. However, I didn't get that part to work, and can live with it.

Andy Thomas
  • 84,978
  • 11
  • 107
  • 151
  • Do foo/plugins and bar/plugins have duplicated plugins? If so, you could optimize the setup a little by using a shared directory, its called a bundle pool. See for example http://stackoverflow.com/questions/582391/installing-eclipse-3-4-plugins-in-a-directory-other-than-eclipse-home-plugins Theres alot of info on this in the Eclipse help too – Fredrik Aug 09 '13 at 08:15
  • Yes, they have duplicated plugins (with both the same name and version across applications). We're not using p2, as far as I'm aware. Perhaps I could still use a shared *plugins* directory and different *dropins* directories? – Andy Thomas Aug 09 '13 at 13:07
  • Note: this approach works when the working dir is the program dir. Otherwise, the app fails to launch. The error shows -startup and --launcher.library using the the program directory as expected. It doesn't any full path for -install. Also, here's a potentially related, fixed Eclipse bug suggesting program dir is supported for relative paths: https://bugs.eclipse.org/bugs/show_bug.cgi?id=200604 – Andy Thomas Aug 22 '13 at 16:50