Patch a plugin with a single class?

后端 未结 2 2012
生来不讨喜
生来不讨喜 2021-01-12 16:02

This is my situation: We have a third party feature in our Eclipse environment. The feature contains several plugins. The plugin contains a bunch of classes. One of the clas

2条回答
  •  梦毁少年i
    2021-01-12 16:32

    I would not try using a fragment. In my experience, the cleanest thing to do would be to use a feature patch. I have successfully used feature patches to do exactly what you are looking to do. It's not simple, but it is robust. You need to do the following.

    1. create a plugin that encapsulates your single class file
    2. create a feature patch that includes your new plugin and that patches the feature that you are targeting.
    3. export your feature patch and create the p2 metadata (to create an update site).
    4. Install into your Eclipse using the install manager
    5. Rejoice!

    6. (optional) Feature patches by default only target a single version of the target feature. So, if the target feature bumps up its version number, the feature patch will silently no longer be applied. However, it is possible to relax the version constraints on the feature patch. This process is described in detail here: http://aniefer.blogspot.com/2009/06/patching-features-part-2.html

    More information:

    http://aniefer.blogspot.com/2009/06/patching-features-with-p2.html http://aniefer.blogspot.com/2009/06/patching-features-part-2.html

    The benefit of using a feature patch over a fragment is that anyone can install the patch and get the patch working, but things are more difficult with a fragment in that end users must muck with manifests.

提交回复
热议问题