OSGI有效版本范围 [英] OSGI Valid Version Ranges

查看:131
本文介绍了OSGI有效版本范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在尝试实现OSGI版本范围(针对不同的主题,但我喜欢他们定义版本范围的方式)。但是我很难在OSGI中找到版本范围的具体定义。

Currently I'm trying to implement OSGI Version Ranges (for a different topic, but I like the way they define version ranges). However I'm having a hard time to find the specific Definition of a Version Range in OSGI.

不幸的是,OSGI API确实包含Version类但不包含VersionRange类。似乎所有OSGI容器都提出了自己对(有些不可修复的)版本范围定义的解释。

Unfortunately, the OSGI API does contain a Version class but not a VersionRange class. It seems like all OSGI Containers come up with their own interpretation of the (somewhat unfindable) Version Range definition.

因此我有几个问题:


  • 如果我使用 versionRange = 1.4.0 ,这会映射到Version> = 1.4.0吗?

  • 这是一个有效的版本范围: versionRange = [1.0.0,0] :我会说是(版本1.0。 0到任何版本),Eclipse实现接受它作为版本但不能正确处理它。

    • 这是一个有效的versionRange以及: versionRange = [1.0.0,0)

    • If I used versionRange=1.4.0, would this map to Version >= 1.4.0?
    • Is this a valid version range: versionRange=[1.0.0,0]: I'd say yes (version 1.0.0 up to any version), Eclipse implementation accepts it as a version but does not handle it correctly.
      • Would this be a valid versionRange aswell: versionRange=[1.0.0,0)?

      推荐答案

      版本范围 在3.2.6节中精确定义OSGi核心规范。你在当前的API中没有 VersionRange 类是正确的,尽管在下一个规范版本中会有。

      Version ranges are precisely defined in section 3.2.6 of the OSGi Core Specification. You're correct that there is no VersionRange class in the current API, though there will be in the next specification release.

      OSGi框架实现提出自己对范围的解释;如果您发现特定框架解释范围的情况与核心规范第3.2.6节不同,那么请针对该框架提出错误。

      OSGi framework implementations do not come up with their own interpretation of ranges; if you find a case where a specific framework interprets a range differently from section 3.2.6 of the Core Spec then please raise a bug against that framework.

      要解决您的具体问题问题:

      To address your specific questions:


      • 是,版本= 1.4.0 关于 Import-Package (或 bundle-version = 1.4.0 Require-Bundle )非正式地映射到version> = 1.4.0。

      • Yes, version=1.4.0 on an Import-Package (or bundle-version=1.4.0 on a Require-Bundle) does map informally to "version >= 1.4.0".

      我相信这两个版本范围都是有效的,但它们是永远不会匹配任何版本。例如。第一个示例仅匹配版本 x 其中 x> = 1.0.0 X< = 0 。没有 x 的值可以满足这两个要求。所以听起来Eclipse的行为正确......它应该成功解析范围字符串,但永远不会返回任何结果。

      I believe that both of these version ranges are valid, BUT they will never match any version. E.g. first example will match only version x where x >= 1.0.0 and x<=0. There is no value of x that can satisfy both of these requirements. So it sounds like Eclipse is behaving correctly... it should successfully parse the range string but never return any results.

      如前所述,来源如果您正在阅读文档的R4.3版本,那么事实是OSGi核心规范的第3.2.6节....第29页。

      As already mentioned, the "source for truth" is section 3.2.6 of the OSGi Core Specification.... page 29 if you are reading the R4.3 version of the document.

      这篇关于OSGI有效版本范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆