P2 is my friend again

If you follow my blogs, then you know about some problems I ran into. the pain starts the week before EclipseCon where suddenly RAP plug-ins are installed into the IDE.

It’s great that more and more projects now are supporting RAP and RCP – redView will follow soon. To support RAP and RCP both together there are some optional dependencies like this:

You see: both Plug-ins – the RCP and the RAP version – are optional. Now it’s up to you to provide the right Plug-in, then other Plug-ins with dependencies to packages from jface, swt etc. can work under both environments.

If using Target Platform definitions you’re free to organize your Target Platform the right way. there are use-cases where only RCP or only RAP or both are used. If you only need one specific UI – Environment in your TargetPlatform and still want to use “include required software” if adding software-sites:

it may help to tell the Target Platform to always include some plug-ins. Unter tab “Environment” you can do this:

In this case the Target Platform will include all from SWT – so if you don’t explicitely include RAP SDK – you’ll only get plug-ins from RCP.

Using Launch Configurations and building Products its up to you to combine the bundles you need.

The problems I run into was that P2 installs RAP bundles into the IDE where you don’t have control, because all was managed by P2 behind the scenes.

And now – starting with Helios M6 – it happened that P2 was resolving dependencies while installing new software or updating.

The solution to avoid that P2 is too greedy is to add a p2.inf inside the META-INF folder of the plug-ins with optional dependencies to RAP:

Now P2 is aware of this and no more RAP bundles in your IDE 🙂

The way to make it all run was hard, I don’t remember since all the years to report so many bugzillas and to do so many tests where you always have to start with a fresh installation to avoid getting things wrong from caches or bundlepools.

Thanks to all helping…

… to make it run for Helios. And to make it clear, because in previous blogs I reported about problems with P2, RAP, Riena,… – no one was guilty. This was a new situation and all happens in very complex environments. (And as Pascal says “Don’t shoot P2 – P2 was only the messenger” )

Developers from so many teams have spent much time to understand and help. This was again a really great experience how much fun it is to be part of the Eclipse Community.

now – after 5 weeks – back to normal work on redView. Starting with Helios M7 you’ll be able to install redView easy and we’ll also provide the workshop from EclipseCon in working environments 🙂 stay tuned…. I’ll blog about…

%d bloggers like this: