如何在两个 Eclipse 插件之间共享通用功能?

How to share common functionality between two Eclipse plugins?

我有两个共享相当多功能的 Eclipse 重构插件,我想将它们分解出来。在 Eclipse 中执行此操作的最佳方法是什么?我是简单地创建一个我在两个插件之间共享的 jar 文件,还是创建第三个(公共)插件并让其他两个插件扩展该插件?我看到后一种方法的唯一问题是,通用插件没有任何可供用户使用的功能(即没有 UI)。

The only problem I see with this latter approach is that the common plugin doesn't have any sort of functionality available to the user (i.e., no UI).

这并不罕见,你已经想出了正确的方法(尽管它是 require 新的作为依赖项,而不是 extend 如果我正在阅读你的问题对)。