【发布时间】:2016-11-02 02:38:55
【问题描述】:
卡拉夫 4.0.3
我有以下伪特征:
<features name="my-feature" xmlns="http://karaf.apache.org/xmlns/features/v1.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.3.0 http://karaf.apache.org/xmlns/features/v1.3.0">
<feature name="C" version="${project.version}" start-level="25" install="auto">
<bundle start-level="25">...BundleC1...</bundle>
</feature>
<feature name="A" version="${project.version}" start-level="30" install="auto">
<feature prerequisite="true">C</feature>
<bundle start-level="30">...BundleA1...</bundle>
</feature>
<feature name="B" version="${project.version}" start-level="35" install="auto">
<feature prerequisite="true">C</feature>
<bundle start-level="35">...BundleB1...</bundle>
</feature>
C 是独立的
A 依赖于 C
B依赖于C
在此示例中,捆绑包“BundleB1”导入了错误的“BundleC1”主要版本,我们收到“缺少要求”错误(如预期的那样)。但是,如果我登录到 karaf 控制台并运行 'feature:list',我会看到 C 已启动,A 已卸载,B 已卸载。
我希望 A 能够启动,因为它只依赖于 C。如果我注释掉整个 C 功能或之后运行 feature:install A,A 将正常启动
如果我将这三个功能中的每一个都放在单独的 feature.xml 文件中,我会得到 C+A 为 Started 和 B 为 Uninstalled 的预期结果。
我做错了什么?
我是否误解了先决条件属性的工作原理?作为旁注,如果我一起跳过先决条件属性,那么将不会安装任何功能...
【问题讨论】:
标签: osgi apache-karaf karaf