xml中的几个版本的插件

xml中的几个版本的插件

本文介绍了feature.xml中的几个版本的插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个基于功能的Eclipse产品,其中所有依赖项分别在依赖项功能项目中指定外部插件。一些依赖项需要不同版本的同一个插件。如何在feature.xml中指定插件的多个版本? Eclipse似乎总是使用当前版本的插件。我试图添加一个严格版本间隔的依赖关系,例如在feature.xml中,但是Eclipse不接受此格式, [1.6.0.v201011041432,1.6.0.v201011041432]

I've created an feature-based Eclipse product where all dependencies respectively external plugins are specified in a dependencies feature project. Some dependencies need different versions of the same plugin. How can I specify several versions of a plugin in a feature.xml? Eclipse seems to always use the current version of a plugin. I've tried to add a dependency with a strict version interval, e.g. [1.6.0.v201011041432,1.6.0.v201011041432], in the feature.xml but Eclipse doesn't accept this format.

推荐答案

当在Eclipse(开普勒)中运行基于功能的产品时,我遇到类似的问题,其中涉及到多个版本的相同捆绑。

I had a similar problem when running a feature based product within Eclipse (Kepler) where multiple versions of the same bundle were involved.

最后我用了一个解决方法 - 我改变了bundle的符号名,所以他们都有不同的名字。如果您因此使用 Import-Package 而不是 Require-Bundle 这将对您为捆绑定义的依赖项没有任何区别或在OSGi运行时,仅在您的功能定义。
这个解决方案不是很漂亮,但至少这样做很简单。

In the end I used a workaround - I changed the symbolic names of the bundles, so they all have different names. If you consequently use Import-Package instead of Require-Bundle this will make no difference in the dependencies you define for bundles or in the OSGi runtime, only in your Feature definition.This solution is not pretty, but at least it's rather easy to do.

想想这个OSGi是为了准确地定位这种用例有相同的依赖/捆绑的多个版本是相当奇怪的Eclipse的支持有多糟糕,如果你真的有这种用例。

Thinking about that OSGi is intended to target exactly this kind of use case where you have multiple versions of the same dependency/bundle it's rather strange how bad the support in Eclipse is, if you actually have this kind of use case.

这篇关于feature.xml中的几个版本的插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 22:50