简体   繁体   English

eclipse rcp中的插件依赖性和lib之间有什么区别

[英]What is the difference between plug-in dependencies and lib in eclipse rcp

I have a large eclipse RCP application. 我有一个大型的Eclipse RCP应用程序。 Looking at the Package Explorer view, I have many plugins. 查看Package Explorer视图,我有很多插件。 Underneath each plug-in there is a Plug-in Dependencies section and a lib directory. 每个插件下面都有一个“插件依赖项”部分和一个lib目录。 What is the difference between the jars in the Plug-in Dependencies section and the lib directory? “插件依赖项”部分中的jar和lib目录之间有什么区别? The Plug-in Dependencies section is not a physical directory on disk. 插件依赖项部分不是磁盘上的物理目录。 Is the plug-in dependencies section a visual representation of the plugin.xml file? 插件依赖项部分是plugin.xml文件的直观表示吗? What is the relationship between these two different things? 这两件事之间有什么关系?

The Plug-in Dependencies section shows you which other plugins this plugin uses. “插件依赖项”部分向您显示此插件使用哪些其他插件。 This corresponds to the 'Require-Bundle' and 'Import-Package' sections of the plugin META-INF/MANIFEST.MF. 这对应于插件META-INF / MANIFEST.MF的“ Require-Bundle”和“ Import-Package”部分。

Any 'lib' folder is not a standard feature of plugins. 任何“ lib”文件夹都不是插件的标准功能。 If the plugin needs to use some non-plugin jars they can be included in the plugin and are usually put in a 'lib' folder. 如果插件需要使用某些非插件jar,则可以将其包含在插件中,通常放在“ lib”文件夹中。 The 'Bundle-ClassPath' entry in the MANIFEST.MF lists everything that is included in the classpath of the plugin. MANIFEST.MF中的“ Bundle-ClassPath”条目列出了插件的类路径中包含的所有内容。

Note: Eclipse plugins conform to the OSGi specification. 注意:Eclipse插件符合OSGi规范。 OSGi calls plugins 'Bundles'. OSGi称插件为“捆绑包”。

As an example here is the MANIFEST.MF from a plugin in one of my RCPs: 例如,这是我的一个RCP中的插件中的MANIFEST.MF:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin.name
Bundle-SymbolicName: greg.music.ogg;singleton:=true
Bundle-Version: 2.0.0.qualifier
Bundle-Vendor: %plugin.provider
Bundle-Localization: plugin
Require-Bundle: greg.music.core;bundle-version="1.0.0",
 greg.music.resources;bundle-version="1.0.0",
 org.eclipse.core.runtime,
 javazoom.jlgui.basicplayer,
 org.eclipse.e4.core.services;bundle-version="2.0.100"
Bundle-ClassPath: .,
 lib/jogg-0.0.7.jar,
 lib/jorbis-0.0.15.jar,
 lib/vorbisspi1.0.2.jar
Bundle-RequiredExecutionEnvironment: JavaSE-9
Import-Package: javax.annotation;version="1.0.0",
 javax.inject;version="1.0.0",
 org.eclipse.e4.core.di.annotations

There is a 'Require-Bundle' for 5 other plugins and an 'Import-Package' for 3 other packages. 对于其他5个插件有一个“ Require-Bundle”,对于其他3个软件包有一个“ Import-Package”。 The 'Bundle-Classpath' includes the main plugin code (shown as '.') and 3 jars in a 'lib' directory. “ Bundle-Classpath”包括主插件代码(显示为“。”)和“ lib”目录中的3个jar。

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

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