Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

ide - Installing Eclipse (3.4+) plugins in a directory other than ECLIPSE_HOME/plugins

There used to be a way to do this, but I can no longer find this in Eclipse 3.4.1 installation I have. Does anyone know how to do this?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Update May 2014, Eclipse 4.x

As oberlies kindly points out in the comments:

Dropins are deprecated! Don't use them!

Even though they are still documented (in Kepler 4.3 for instance), this thread adds:

One of the reasons that Eclipse does not recommend the dropins folder method of installation is that there is no feedback if something goes wrong. Any number of things could be getting in the way.

  • If you were using the install UI, you'd be informed of the problems before any changes are made.
  • With dropins, Eclipse tries to install and start as much as it can and you don't really know what's going on.

A Local deployment, as shown in this tutorial, would rather use File → Export → Plug-in Development → Deployable plug-ins and fragments.

But the final destination remains in ECLIPSE_HOME/plugins.


Original answer (2009, Eclipse 3.x)

You should add your plugins in ECLIPSE_HOME/dropins.

If you want to defined common plugins, use bundle pools (also introduced here)

http://2.bp.blogspot.com/_Xv6Yjx9z9no/SGftQroKv6I/AAAAAAAAAJc/JcPTai4GhiU/s400/p2+shared+verzeichnisse.png

You can also use an own extra dropins folder: simply add a parameter into eclipse.ini:

-Dorg.eclipse.equinox.p2.reconciler.dropins.directory= /your_path/e34shared_dropin

This extra dropins location can be used from more then one Eclipse installations - so you can use it as a shared dropins (watched directory).

For Bundle Pool, you have here a step by step procedure:


To better address your issue, you might find interesting the following article:

p2: how I install plugins in extension locations (from the Eclipse and Java Blog by Michael Scharf blog)

The following procedure explains how to install plugins into different extension locations and share those extension locations between different eclipse installations using the p2 update manager and link files. For a lengthly discussion see bug 224145

(Note: p2 is the "new" way to manage plugins, links is the "old" way to reference plugins outside the eclipse installation directory)

I keep a set of different extensions locations in C:eclipseextensions (each extension location is in a subdirectory of that directory).
Suppose I want to install foo into the new extension location C:eclipseextensionsfoo.

  1. I start eclipse with:
-configuration C:eclipseextensionsfooeclipseconfiguration
  1. I install foo using the update manager.

  2. Now I can use the extension by creating a foo.link file inside the links directory of an eclipse installation (you might have to create the [eclipse]links directory) containing:

  path=C:/eclipse/extensions/foobar

That's it :-)

Notes:

  • You have to the forward slashes on windows in the links file.
  • This procedure works for eclipse 3.4 and 3.5.
  • You don't have to create any directory specified by the -configuration parameter. Eclipse will do that for you.
  • It is important to follow the pattern EXTENSION_NAME/eclipse/configuration for the "-configuration" parameter because p2 will put the plugins one directory above the configuration directory and link files require that the directory that contains the plugins is called eclipse.
  • With this structure I can update plugins into the extension locations by running eclipse with the -configuration and then do the update.

Advanced use: If I want to install bar based on my foo extension, I create a link file to foo in the bar extension location links directory:

C:eclipseextensionsareclipseconfigurationlinksfoo.link

and follow my standard procedure described above (the links directory can be populated before the first run of eclipse)...

Note for eclipse 3.4: If you are using eclipse 3.4 and you want to use the eclipse default update sites, you have to run eclipse without "-configuration" and export them (Help->Software Updates->Available Software (tab)->Manage Sites->Export), so you can import them into the "-configuration" eclipse.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...