Thursday, February 26, 2009

(J|Str)uggling with Eclipse Updates and Plug-Ins

The Eclipse guys are working a lot on the update mechanism. Which they should btw, because it is still a PITA. Switching to a new Eclipse version takes way more time than it should. I seem to be able to upgrade my whole operating system quicker than Eclipse. (Yeah, screw those Mac OS fanboys.) And I am not even talking about porting home-brewed plug-ins. Anyway, intro-rant over, now for some info.

Now that 3.5 is almost out we dared switching from 3.3 to 3.4. Yeah, I know, we're conservative uptight lamers. Anyways, I used to keep all the plug-ins I collected from random sites separate from the standard ones supplied by eclipse.org. Once you knew how, it worked alright. With the update manager you could create a new extension location (like a directory Eclipse-3.3-Plugins somewhere in your home) that looked like this:

Eclipse-3.3-Plugins/
  eclipse/
    .eclipseextension
    features/
    plugins/

Standard eclipse directory structure except the special file .eclipseextension. An empty file does the job.

Then, when you downloaded extensions you just told the update manager to store the stuff in that location and you were good. When you switched to a new Eclipse version you copied the file configuration/org.eclipse.update/bookmarks.xml from your old Eclipse installation to the new one to keep all your update sites. Not exactly what I call user friendly migration but it worked. Much better than manually adding all the update sites again.

I did that when switching to 3.4. Unfortunately that seems to deactivate Eclipse's new p2 Update Manager mechanisms and enable the Update Manager's compatibility mode. So I googled and read for a few hours. Because I ain't got anything else to do, haha.

In short: fiddling with Eclipse's plugins and features directories is no longer encouraged. I didn't really find a way to add an external directory for plug-ins, though. The option you seem to have with 3.4 seems to be the dropins folder.

There you can either have a standard Eclipse directory structure like outlined above or have plug-ins directly or group them in subdirectories or even have traditional link files. See the p2 document.

After having spent half the day with that, um, stuff, I went for the quickest option and created a symbolic link to my plug-ins directory:

Eclipse-3.4/
  ...
  dropins/
    eclipse@ -> /Users/thm/Apps/Eclipse-3.4-Plugins/eclipse

And no, I don't have the feeling I am an expert on that. I just wanted to make it work. Tomorrow I will try to add all my update sites and see where they are stored. grep(1) is my friend.

No comments: