Osgi ApacheKaraf功能先决条件
卡拉夫4.0.3 我有以下伪特性:Osgi ApacheKaraf功能先决条件,osgi,apache-karaf,karaf,Osgi,Apache Karaf,Karaf,卡拉夫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
<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>
…BundleC1。。。
C
…BundleA1。。。
C
…BundleB1。。。
C是独立的A取决于C
B取决于C 在本例中,bundle“BundleB1”导入了错误的“BundleC1”主版本,我们得到了“缺少需求”错误(如预期的那样)。但是,如果我登录到karaf控制台并运行“功能:列表”,我将看到C已启动,A已卸载,B已卸载 我希望A能够启动,因为它只依赖于C。如果我注释掉整个C功能,或者如果我随后运行
feature:install A
如果我将这三个特性分别放在单独的feature.xml文件中,我会得到C+A启动和B卸载的预期结果
我做错了什么
我是否误解了前提属性的工作原理?作为旁注,如果我一起跳过prerequisite属性,那么就不会安装任何功能。Whatshover…这是Karaf 4中的预期行为:Karaf创建一个子系统,其中包含所有要安装的功能。这个子系统在一个过程中得到解决:作为一个整体,它要么成功,要么失败
prerequisite
属性告诉Karaf在一个独立的子系统中安装此功能:在尝试解析其他功能之前,安装并启动所有捆绑包
就你而言:
- C已安装/启动李>
- A+B已解决,但失败
org.apache.karaf.features.cfg
,那么您可以指定要安装的功能,并创建带括号的组,如:(C)、(A)、(B)您能否详细说明如何使用org.apache.karaf.features.cfg
和“组”或者给我指出一些文档的方向?我发现karaf文档非常缺乏,而且很难找到相关的示例。@JérémieB这是关于在任何地方(特别是)记录的功能文件和子系统之间关系的信息吗?