如何将 camel-http4 添加到 Karaf features.xml 文件?

How do I add camel-http4 to a Karaf features.xml file?

如果我加上

<bundle>mvn:org.apache.camel/camel-http4/2.15.1</bundle>

然后我得到下面的错误。

在我的 Karaf 蓝图骆驼路由中使用 camel-http4 的正确方法是什么?我该如何修改features.xml?

org.osgi.service.resolver.ResolutionException:无法解析 root:缺少要求 [root] osgi.identity; osgi.identity=social_importer.kar;类型=karaf.feature; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]";过滤器:="(&(osgi.identity=social_importer.kar)(类型=karaf.feature)(版本>=1.0.0.SNAPSHOT)(版本<=1.0.0.SNAPSHOT))" [原因:无法解析 social_importer.kar/1.0.0.SNAPSHOT:缺少要求 [social_importer.kar/1.0.0.SNAPSHOT] osgi.identity; osgi.identity=org.apache.camel.camel-http4;类型=osgi.bundle;版本="[2.15.1,2.15.1]";分辨率:=强制性 [原因:无法解决 org.apache.camel.camel-http4/2.15.1:缺少要求 [org.apache.camel.camel-http4/2.15.1] osgi.wiring.package;过滤器:="(&(osgi.wiring.package=javax.servlet)(版本>=2.5.0)(!(版本>=4.0.0)))"]]


谢谢,到目前为止,我在您的帮助下发现了以下帮助,仍在调查中。

karaf@root()> feature:repo-add mvn:org.apache.camel.karaf/apache-camel/2.15.2/xml/features
Adding feature url mvn:org.apache.camel.karaf/apache-camel/2.15.2/xml/features
karaf@root()> feature:install camel-http4
karaf@root()> feature:install camel-http
karaf@root()> feature:install camel-ahc

您可以使用

从 karaf shell 安装 Camel 组件

功能:安装 camel-http4

安装使用 camel-http4 所需的所有功能包。完成一次后,您就可以安装自己的包了。

如果您有自己的features.xml文件,可以参考其他功能

<feature>camel-http4</feature>

并且您可能需要在 features.xml 文件的顶部引用 Camel 功能,例如 Camel 在此处对其他人所做的:https://github.com/apache/camel/blob/master/platforms/karaf/features/src/main/resources/features.xml#L20