title: How do I patch an eclipse plug-in using a fragment plugin and deploy it in my eclipse product?
body: <p>I'm trying to apply a patch to an existing plug-in using a fragment plugin as described here:</p>
  
  <p><a href="https://wiki.eclipse.org/Steps_to_use_Fragments_to_patch_a_plug-in" rel="nofollow">Steps to use Fragments to patch a plug-in - Eclipsepedia</a></p>
  
  <p>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 <em>Modify the Host package Manifest settings</em> 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?</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>(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.)</p>
  
  <p>UPDATE*: I create my build using the Tycho plugin to Maven <a href="http://www.eclipse.org/tycho/" rel="nofollow">Tycho - Building Eclipse plug-ins with maven</a>.</p>
  
  <p>Thanks for linking to "OSGi Core Release 5 Specification". That was useful reading.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>*: not sure on answering etiquette; don't have enough reputation to do many things. Comment box only accepts a small number of chars.</p>