且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何导出具有依赖项的 Eclipse 插件?

更新时间:2022-12-12 22:19:12

使用 /dropins 的问题是它没有执行依赖解析来查找并包含所有需要的依赖.相反,您需要通过 p2(Eclipse 的软件包安装基础架构)进行安装 - 在 Eclipse 中,当您选择 Help > Install New Software...p>

  • 创建一个功能项目来包含您的插件,将您的插件包含在功能中.在功能编辑器的 Dependencies 选项卡上,使用 Compute 按钮来声明插件所需的依赖项(或者如果您愿意,可以手动添加它们).
  • 为您的功能创建一个更新站点项目.包含您的功能,构建站点(右键单击 site.xml 文件),然后使用 Help > Install New Software... 选择本地更新站点并从中安装.

Eclipse 帮助内容可以详细解释所有这些内容,但这是一个非常简单的过程.

So I have begun to edit an existing plugin. As such it has dependencies. I want to take this plugin and put it into another eclipse IDE (not my current one). This eclipse IDE will not have the dependent plugin jars installed. Right now I am using the droppins folder, however this does not reach out and install the dependencies I need. So what is the best way for me to install this plugin into another eclipse IDE? And as a complete package/simple onetime step.

The problem with using /dropins is that it does not perform dependency resolution to find and include all required dependencies. Instead, you'll want to install via p2 (Eclipse's package installation infrastructure) - in Eclipse it's what you get when you select Help > Install New Software...

  • Create a Feature Project to contain your plugin, include your plugin in the Feature. On the Dependencies tab of the Feature editor, use the Compute button to declare the dependencies your plugin requires (or manually add them if you prefer).
  • Create an Update Site Project for your Feature. Include your Feature, build the site (right-click on the site.xml file), and then use Help > Install New Software... to select the local update site and installing from that.

The Eclipse Help Contents can explain more about all of this, but it's a pretty straightforward process.