简体   繁体   English

在Eclipse PDE中导入并安装所需的插件包

[英]Import and install required plugin bundles in Eclipse PDE

I created a new plugin project in Eclipse for RCP and RAP Developers (Oxygen). 我在Eclipse中为RCP和RAP开发人员(Oxygen)创建了一个新的插件项目

I now want to use (for example) Jimfs within my plugin, so I have to add this to my plugin dependencies. 现在,我想在插件中使用(例如) Jimfs ,因此必须将其添加到插件依赖项中。

The solution that works , but which is not satisfying at all: 可行的解决方案 ,但一点都不令人满意:

  • Add Jimfs to the Maven dependencies 将Jimfs添加到Maven依赖项
  • Copy Jimfs and and all its dependencies to a lib folder within my project. 将Jimfs及其所有依赖项复制到我项目中的lib文件夹中。 (I use a plugin for this) (我为此使用一个插件)
  • Add the bin -Folder to the bin.includes configuration in the build.properties file bin -Folder添加到build.properties文件中的bin.includes配置中
  • Add lib/jimfs-1.1.jar to the Bundle-ClassPath section of META-INF/MANIFEST.MF lib/jimfs-1.1.jar添加到META-INF/MANIFEST.MFBundle-ClassPath部分

What I want and how I think this should work: 我想要什么以及我认为这应该如何工作:

Add Jimfs to the Required Plugins section of this window . 将Jimfs添加到此窗口的“ Required Plugins部分。 However, when I click Add the plugin is not available in the list. 但是,当我单击“ Add ”时,列表中没有该插件。 How do I make it available as a plugin? 如何使它作为插件可用?

Also, if someone imports my plugin project then I want the required plugin to be automatically downloaded from the internet. 另外,如果有人导入了我的插件项目,那么我希望从互联网上自动下载所需的插件。 How do I achieve this? 我该如何实现?

Only code which is written to be an Eclipse plugin can be added as a dependency. 只能将编写为Eclipse插件的代码添加为依赖项。 The current method that you are using is correct for a non-plugin jar. 您正在使用的当前方法对于非插件jar是正确的。

You could write a plugin which just contains the Jimfs jar. 您可以编写一个仅包含Jimfs jar的插件。 You would use the same procedure to include the jar and use Export-Package in the MANIFEST.MF to make the packages in the jar available. 您将使用相同的过程包含jar,并在MANIFEST.MF中使用Export-Package使jar中的软件包可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM