.releng

automation, application, assembly, and angst

HOWTO: Use the p2 director to control where you install

A number of people have remarked to me that there’s a very important feature missing in Eclipse 3.4 Ganymede’s p2 Update UI, which they consider a regression from Eclipse 3.3 Europa’s Update Manager UI.

Specifically, the feature — introduced in Eclipse 3.1? — that allows users to choose where to install a new feature, rather than the default eclipse/features/ and eclipse/plugins/ folders.

The simplest hack available to get this option back is to use the Update UI to install what you want into Eclipse, then go move all the newly created files in eclipse/features/ and eclipse/plugins/ into a new folder. You’ll know which ones are new (and therefore safe to move) because they’ll all share the current timestamp, whereas the base Eclipse install will have its earlier timestamp. Kludgy, perhaps, but it works.

But, you say, surely there’s a better way? Yes, there is. It’s the p2 director.

Here are two ways to install a feature using the p2 director: one installing directly into the dropins folder, and one installing into any folder on your drive, then LINKED from dropins using a .link file. Yes, .link files still work.

Should you want to script the installation of a feature into the eclipse/ root folder (ie., for building a product, perhaps?) you can use this third script to reuse the existing SDKProfile. The added benefit is that only the single feature you chose to install shows up in the Help > Software Updates... Installed Software dialog, rather than ALL the subfeatures required or contained by that feature. It’s a little cleaner, but you’re back to the “everything in eclipse/plugins/ and eclipse/features/” scenario — though for a product, or “all-in-one” bundle, like the Standalone BPMN Modeler that’s probably better than spread around the disc.

Got a few minutes to try this? Then why not contribute your own example (eg., for Windows or Mac), for your project?

Posted July 11th, 2008 by in category: p2, scripting, update manager, usability
You can skip to the end and leave a response. Pinging is currently not allowed.

4 Responses to “HOWTO: Use the p2 director to control where you install”


  1. Antoine Toulm Says:

    Thanks Nick!

    As for the BPMN modeler we have asked to have it packaged as an EPP. I’ll compare both procedures and will let you know which one is the best to create a product.


  2. Kristoffer Peterh?nsel Says:

    Well, that is all nice and dandy. But won’t updates to the installed plugins/features be put into the main installation as opposed to in the linked folder (As mentioned in bug 230373 - https://bugs.eclipse.org/bugs/show_bug.cgi?id=230373)? Making the entire performance irrelevant as you are forced to ‘clean up’ every time there is an update.


  3. Nick Boldt Says:

    Agreed, it’s a mess. I’ve come to the realization that in the new p2 era, you’re better off simply installing everything into the eclipse root. However, you can now (3.5M6) use an existing install as a p2 repo when installing into a new Eclipse, eg., for when moving from one platform milestone to another.


  4. Nick Boldt Says:

    Oh, and BTW, link files now only work if the target directory includes the empty, and seemingly pointless, .eclipseextension file. Good times.

Leave a Reply

You must be logged in using your Eclipse Bugzilla account to post a comment.

Recent Posts

Archives

Categories

Meta