如何用Bnd创建osgi片段?
今天,我深入了解了 Eclipse 的 bndTools。我有一个良好的开始,但我问自己是否可以使用 bndTools 或 bnd。从 bnd 项目描述来看,它告诉我 Fragment-Host 标头被 bnd 忽略,但还没有找到这意味着什么。
有人知道是否可以使用 bnd 创建 osgi 片段,如果可以的话该怎么做?
问候马库斯
Today I had a deeper look inside the bndTools for Eclipse. I had a good start, but I ask myself if it is possible to create osgi fragments with bndTools or bnd. From the bnd project description it tells me that the Fragment-Host header is ignored by bnd, but have not found out what this means.
Does someone know if creating a osgi fragment is possible with bnd, and if so how to do that?
Regards Markus
片段包只有两个方面是特殊的:
Bundle-Activator
标头,并且Fragment-Host
标头与您要附加到的主机的符号名称。除此之外,它与其他捆绑包一样,因此 bnd 不需要以任何特殊方式处理它。 bnd 默认情况下“忽略”它无法识别的所有标头,在这种情况下,它会将它们逐字复制到生成的包的清单中。
在 Bndtools 中,您可以在
Source
选项卡中添加自定义标头(即 Bndtools 不直接支持的标头)。A fragment bundle is special in only two ways:
Bundle-Activator
header, andFragment-Host
header with the symbolic name of the host you want to attach to.Other than that, it's a bundle like any other, so bnd does not need to handle this in any special way. bnd by default 'ignores' all headers it doesn't recognize, in which case it copies them verbatim to the resulting bundle's manifest.
In Bndtools, you can add custom headers (i.e., those not directly supported by Bndtools) in the
Source
tab.