I'm trying to apply a patch to an existing plug-in using a fragment plugin as described here:
Steps to use Fragments to patch a plug-in - Eclipsepedia
The patch to the host plugin involves replacing a single class file with an updated class file. But I don't get the concept in section Modify the Host package Manifest settings steps 5) to 11). Here it instructs you to modify the host plugin. I thought the whole idea is that you don't have to touch the host plugin - its the fragment that you deploy that adds the patch?
My product consists of eclipse platform and org.eclipse.cdt features plus my own plugins that use cdt. It is the org.eclipse.cdt.core plugin that I would like to patch.
I've followed the steps in the eclipse wiki and created my fragment project containing the package and class I want to patch in the host plugin. I've built this in maven and when I run this product I see my fragment plugin is active, but the class it contains is not getting called; the original host plugin class is.
I'm guessing the problem is that the modified host plugin is not in my deployed product. There aren't any steps included in the fragment guide on advice for deploying the host plugin and I'm not sure how/why it is necessary.
(I've used a feature patch successfully in the past for this sort of thing, but only created using the PDE - I couldn't get my feature patch to build under maven - that's why I'm exploring the use of fragments to see if I can get them to build under maven.)
UPDATE*: I create my build using the Tycho plugin to Maven Tycho - Building Eclipse plug-ins with maven.
Thanks for linking to "OSGi Core Release 5 Specification". That was useful reading.
So if my understanding is correct a fragment can only overlay its class over the host plugin's if the host plugin has already been "prepared" to be patched with a fragment. This involves modifying the host plugin's manifest. Specifically: 1. add a new library and move that above '.' package. Remove this library from the build properites; the library is just a reference and should not be created by the host plugin. + add Eclipse-ExtensibleAPI: true to the manifest.mf file + bump the version number.
In my case, it seems, if I wanted to patch the org.eclipse.cdt.core plugin using a fragment I would have to deliver the prepared version of the org.eclipse.cdt.core plugin plus my fragment plugin.
*: not sure on answering etiquette; don't have enough reputation to do many things. Comment box only accepts a small number of chars.