用一个类修补一个插件? [英] Patch a plugin with a single class?

查看:95
本文介绍了用一个类修补一个插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的情况:我们在Eclipse环境中有第三方功能。该功能包含几个插件。该插件包含一堆类。其中一个类包含一个错误。



我们已经能够找到一个解决方案的bug,所以我们有一个工作版本的课程与错误。



不幸的是,这个插件被一个55页长的EULA(由IBM)所覆盖,所以我认为假设反编译jar,交换类文件,重新编译和分发是合法的,这是非常安全的。我不是法律专家,但我猜测我们无法以任何方式篡改jar文件。



所以这意味着我有一个单独的类文件,我想要加载,而不是插件中的类,这是可以吗? >



页面建议使用片段,但这需要修改插件中的清单。



这个问题与我一样的问题,但在这种情况下,可以访问源代码,他可以构建一个插件。



这个 blogpost 显示如何使用功能补丁,但他们要求我能够构建我自己的插件,我不能,因为我只有一个类。

解决方案

我不会尝试使用片段。根据我的经验,最干净的事情是使用功能补丁。我已经成功使用功能补丁来完成你正在做的工作。这不简单,但它是强大的。您需要执行以下操作。


  1. 创建封装单个类文件的插件

  2. 创建一个包含新的功能补丁插件,并补丁您定位的功能。

  3. 导出功能补丁并创建p2元数据(以创建更新站点)。

  4. 使用安装管理器安装到Eclipse中

  5. 欢乐!


  6. (可选)默认情况下功能修补程序定位目标功能的单一版本。因此,如果目标特征会突破其版本号,则功能补丁将静默地不再应用。但是,可以放松功能补丁上的版本约束。此过程在此详细描述: http://aniefer.blogspot .com / 2009/06 / patching-features-part-2.html


更多信息:



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



在片段上使用功能补丁的好处是任何人都可以安装修补程序并使补丁工作,但是在最终用户必须使用清单的碎片中,更为困难的是, p>

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 classes contains a bug.

We have been able to find a solution to the bug, so we have a working version of the class with the bug.

Unfortunately this plugin is covered by a 55 page long EULA (by IBM) so I think it's pretty safe to assume that decompiling the jar, exchanging class files, recompiling and distribute is legally out of the question. I'm no legal expert, but I'd guess we cannot tamper with the jar files in any way.

So this means I have a single class file that I want to be loaded instead of a class in a plugin, is this at all possible?

This page suggests using fragments, but this requires modifying the manifest in the plugin.

This question has the same problem as me, but in that case there is access to the source code and he is able to build a plugin.

This blogpost shows how use feature patches, but they require that I'm able to build my own plugin, which I cant since I have just the one class.

解决方案

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.

这篇关于用一个类修补一个插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆