【发布时间】:2015-11-26 10:31:44
【问题描述】:
我有一个使用 Maven 的 Java 项目,我使用的是 Karaf 3.0.4。 我使用 Maven 插件创建 .kar 文件:
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>features-maven-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<id>create-kar</id>
<goals>
<goal>create-kar<goal>
</goals>
<configuration>
<featuresFile>path/toMy/featureFile.xml</featuresFile>
</configuration>
</execution>
</executions>
在这个featureFile.xml中,我添加了必要的特性和捆绑依赖;它工作正常:.kar 文件已创建。
现在,我想在这个 .xml 文件中添加 Karaf 存档依赖项,但我没有找到方法。我期待的是这样的:
<feature name="myFeature" version="1.0" install="manual">
<feature>anotherFeature</feature>
<bundle>path/to/aBundle</bundle>
<kar>path/to/aKarafArchive</kar>
</feature>
你有什么想法吗?是否可以 ?
编辑
这是我的 featureFile.xml
<?xml version="1.0" encoding="UTF-8"?>
<features name="featureFile" xmlns="http://karaf.apache.org/xmlns/features/v1.2.1">
<feature name="aFeature" description="Simple example" version="1.0" install="manual">
<feature>CodeHaus</feature>
<bundle>mvn:org.testng/testng/6.8.8</bundle>
</feature>
<feature name="CodeHaus" description="">
<details>Get CodeHaus bundles</details>
<bundle>mvn:org.codehaus.jackson/jackson-core-asl/1.9.2</bundle>
<bundle>mvn:org.codehaus.jackson/jackson-mapper-asl/1.9.2</bundle>
</feature>
</features>
【问题讨论】:
-
你能发布 featureFile.xml 吗?
-
你不能从 feature.xml 添加依赖到其他 kar 文件
标签: java bundle maven-plugin apache-karaf apache-servicemix