Apache Karaf功能依赖项

问题描述 投票:3回答:1

在feature.xml(Apache Karaf供应机制)中,标记feature具有dependency属性。此属性有什么作用?

例如:

<feature dependency="true">custom-feature-name</feature>

我在哪里可以找到任何信息?

经过简短的谷歌搜索后,我只在dependency标签上找到了bundle属性:

依赖项属性的作用是标记捆绑是依赖项。如果已经满足依赖关系(现有的捆绑包已经导出相同的软件包/版本),则不会安装它。如果已安装声明的功能解析器(例如,已安装obr),则会发生此行为。

来源:http://karaf.922171.n3.nabble.com/features-xml-dependency-quot-true-quot-td3286359.html

但是仍然没有有关功能标签的信息。

apache-karaf karaf
1个回答
0
投票

似乎是依赖项的定义

<feature name="${project.name}-cxf" version="${cxfVersion}" description="Gets CXF up and running." install="auto">
    <feature version="${cxfVersion}" dependency="true">cxf</feature>
</feature>

意味着功能$ {project.name} -cxf不必启动cxf,因为已声明其他东西可以提供它。这确实是违反直觉的。谁提出了可笑的错误称谓?

要自动安装cxf,实际上应将其设置为false。当dependency =“ true”并再次设置为false时,可以通过查找功能$ {project.name} -cxf的名称来更改此名称。

© www.soinside.com 2019 - 2024. All rights reserved.