如何修补 Eclipse 插件?

2022-01-16 00:00:00 eclipse-plugin java eclipse

我想修复一个 Eclipse 插件(WTP 的官方插件)中的一个错误.我在本地更改了源代码,调试了它 - 一切都很好.

I'd like to fix a bug in an eclipse plugin (an official plugin of the WTP). I locally changed the source code, debugged it - everything is fine.

现在我想将此更改传播到我的 Eclipse 安装中,但我遇到了问题.似乎有不止一种方法可以实现这一点,例如:

Now I'd like to propagate this change to my eclipse installation, but I am facing problems. There seems to be more than one way to achieve this, e.g.:

此站点推荐的片段,但 Eclipse 常见问题解答 不建议这样做.

This site recommended fragments, but the Eclipse FAQ disadvises that.

但我被卡住了,似乎没有办法对我有用.

But I am stuck and no way seems to work for me.

更新:

按照建议,我尝试创建和安装功能补丁.在此安装之后,将安装功能补丁,但不安装包含补丁的插件.该插件的先前/现有版本仍然存在并处于活动状态.

I tried to create and install a feature patch, as suggested. After this installation the feature patch is installed, but not the containing patched plugin. The previous/existing version of the plugin is still present and active.

我想知道为什么会这样?这与官方插件的签名有关吗?是否有日志可以查看为什么没有安装补丁插件?

I'd like to know why this is the case? Does this something have to do with signing of the official plugins? Is there a log to see why the patched plugin has not been installed?

最终更新:

问题是我修补了父功能(已在 eclipse 安装详细信息中显示),而不是直接包含插件的直接功能.在为修补指定正确/最低级别"功能后,一切都按预期工作.

The problem was that I patched a parent feature (which has been shown in the eclipse installation details), not the direct feature which directly contained the plugin. After specifying the correct/"lowest-level" feature for patching, everything worked as expected.

推荐答案

最好的方法是创建所谓的功能补丁".功能补丁由您正在修补的插件的全新版本以及描述正在修补的内容的功能组成.请参阅这篇有用的博文:

The best approach is to create what's known as a "feature patch". A feature patch consists of the entire new version of the plugin you are patching along with a feature that describes what's being patched. See this useful blog post:

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

相关文章