What is the best way to apply a feature/plugin patch? There is a patch on a bug that wasn't included in Helios - and all I really need to do is patch one class. I already have a patched project and a built .jar - I just don't know the best way to get it to work well with P2.
It looks like I had some success by creating a "Feature Patch" project (which adds a <requires/> with a child <import feature .../> with patch=true in the feature.xml), then including the patched plugin project under "Plug-ins" (which adds a <plugin .../> element.)
Is there a better way of doing this? If not, is exporting the Feature Patch project as "Deployable Features", then using the created folder as an Eclipse update site also the best way of getting Eclipse to recognize the patched plugin?
Finally, this results in an update site of over 1 MB, as it includes the entire feature / patched plugin. Is there a way to only include the single patched *.class file, such that it is used instead of the one in the original plugin? Ideally, the update site would then only need to be a few KB.
Paul Webster Messages: 6859 Registered: July 2009 Location: Ottawa
That's the correct way to patch an eclipse install.
1) generate the plugin with a higher version (3.6.0 becomes 3.6.1, for
2) create a feature patch to patch the feature that contains the
original plugin, and the feature patch refers to the new plugin.
3) create a p2 repo for the feature patch + new plugin.
That p2 repo can then be installed. I also believe that you can make
the feature patch optional in some way, so that when the service release
comes along p2 can update to the new version of the original feature and
leave your feature patch behind.
The only way to replace a single class from a plugin is if you provide a
fragment to the host plugin, and the host plugin allows it through
Bundle-ClassPath tricks. Very few plugins allow this kind of patching,
because the plugin has to have it set up in its MANIFEST before it is