Managing Plugins in Eclipse

Most Eclipse users end up using at least a few plugins to add some functionality to Eclipse. There are a few techniques which make working with plugins much easier, in terms of management, sharing between multiple simultaneous Eclipse installs, and ease of upgrade from one Eclipse version to another.

My #1 suggestion is to never install plugins under the root of your Eclipse install itself, but rather to use an external location. The Update Manager (Help | Software Updates | Find and Install…) will default to suggesting that you install updates under the Eclipse root. Additionally, when manually installing updates, most people just extract the files in the main Eclipse install (under eclipse/plugins or eclipse, depending on how the plugin is packaged). However, taking an extra minute to set up one or more external plugin locations will make your life a lot easier later.

Getting Eclipse to create your external plugin location: if you are using the Update Manager to pull down updates, the easiest way to create an external plugin location (aka plugin ’site’, aka ‘extension location’) is to have the Update Manager do it for you. When you have selected the plugin(s) you want to download, you’ll get to a tab which is titled “Install Location”. Instead of selecting the default location, which will be under the Eclipse install tree, click the ‘Add Site’ button, and create an external site. I generally keep my eclipse installs under one common root, e.g.

  c:/dev/eclipsehome/3.0.1
  c:/dev/eclipsehome/3.1M4

so for a main external plugin site, I use

  c:/dev/eclipsehome/plugins

It’s generally safe to put all plugins dowloaded via the Update Manager to the same external site. If you are downloading multiple plugins in fact, you should click on each and make sure you are downloading to the external site, and not the default one under Eclipse.

If you extract any manually downloaded plugins to this external site, they will also be automatically seen and used, just as if you had extracted them under Eclipse itself. For ease of management though, you may want to use another external site (see below) for manually downloaed plugins.

Upgrading to a new version of Eclipse: When you upgrade to a new version of Eclipse, all you have to do is tell that version about the external plugin site. Go to Help | Software Updates | Manage Configuration. Then click on ‘Add Extension Location’ in the right pane. Now point to the external plugin site you created previously, and Eclipse will know about all the plugins in there.

Manually creating an external plugin site: If you are not going to be downloading at least one plugin via the Update Manager, then you’ll have to create the external site manually. You may in any case want to create additional external sites so that you can manage manually added plugins better. To create an external site, create the root directory, e.g.

  c:/dev/eclipsehome/plugins-manual

and underneath that an eclipse directory, which should itself contain a features directory and a plugins directory.

  c:/dev/eclipsehome/plugins-manual/eclipse
  c:/dev/eclipsehome/plugins-manual/eclipse/features
  c:/dev/eclipsehome/plugins-manual/eclipse/plugins

Finally, in the eclipse directory in the tree you just created, create a file called .eclipseextension, containing:

id=org.eclipse.platform
name=Eclipse Platform
version=3.1.0

This is specific to the Eclipse 3.1 stream, but you could use version 3.0.0 without issues. Note also that if you have an already created external plugin site, you can just copy the .eclipseextension file from there. Now as described above, go to the Manage Configuration tab, and add this location as an ‘Extension Location’. From now on, any plugins you extract to this external site will be picked up automatically by Eclipse. Again, when you upgrade to a new version of Eclipse, just point it at this and any other external sites.

Using multiple external sites to manage manually installed plugins: Ideally any plugin available via an update site should just be installed via the Update Manger. It makes management and updates a lot easier. For other plugins which have no update site, using one main external plugin site is fine. I do find that for a few manually installed plugins, which have a very large amount of files in them, it makes sense to create an external plugin site just for the plugin, or smaller group of plugins. For example, the Web Tools Project Milestone 2 release needs some development versions of the EMF SDK, GEF, and JEM. While the stable release of these are available from the normal eclipse.org update site via the Update Manager, these development releases need to be downloaded. But the plugins include many many different packages, and I don’t like mixing them together with all my other plugins, since all these files will make a manual upgrade later to another development release more complex than it should be if they are lumped together.

The easiest thing to do is just make these plugins their own external sites. The zip files already include the /eclipse, /eclipse/features, and /eclipse/plugins. so just extract them somewhere, e.g. for
GEF-SDK-I20041216.zip

I would use

c:/dev/eclipsehome/GEF-SDK-I20041216

then add in the .eclipseextension file under the eclipse directory, then point to the plugin as an external site. When you want to update just this plugin, unlink from this version, and link to the new one.

Now you’ll have to decide for yourself is it’s really worth it to have multiple external plugin sites. Eclipse is perfectly happy if you just lump all your plugins together in one external site, and there can be multiple versions, with all but one disabled, so this is more about easy management and reduction of clutter than anything else. If you don’t mind having all those files together (including a bunch of obsolete ones), then just use one external location. Of course,if you can use the Update Manager instead, that’s even better.

Update Manager bookmarks: Note that Eclipse 3.1M4 added the ability to export update site bookmarks from the Update Manager, so that when you upgrade to a new version, you can just import your bookmarks from the previous one. However, for earlier releases of Eclipse, just grab the bookmarks.xml file from
.../eclipse/configuration/org.eclipse.update
in your old Eclipse version, and drop it to the same directory in the new one.

 

WordPress database error: [Can't open file: 'colins_comments.MYI' (errno: 145)]
SELECT * FROM colins_comments WHERE comment_post_ID = '16' AND comment_approved = '1' ORDER BY comment_date

Leave a Reply