如何生成Karaf特征描述符

如何生成Karaf特征描述符

本文介绍了如何生成Karaf特征描述符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试自动生成Apache Karaf的(2.3.0)功能描述符文件( features.xml ).

I am trying to automatically generate Apache Karaf's (2.3.0) feature desscriptor file (features.xml).

来自 Karaf的文档了解到我可以使用功能"包装.

From Karaf's doc I have learned that I can use the "features" packaging.

我的 pom.xml

<project>
...
    <packaging>feature</packaging>


    <dependencies>
        <dependency>
            <groupId>org.apache.jclouds</groupId>
            <artifactId>jclouds-core</artifactId>
            <scope>provided</scope>
            <version>${jclouds.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <version>${karaf.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <startLevel>80</startLevel>
                    <aggregateFeatures>true</aggregateFeatures>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

但是mvn clean install抱怨:

我也尝试使用features-maven-plugin,但是得到的结果相同.

I have also tried to use the features-maven-plugin, but I get the same result.

推荐答案

我注意到org.apache.karaf.tooling:karaf-maven-plugin:jar:2.3.0在行家仓库中不存在.

I noticed that the org.apache.karaf.tooling:karaf-maven-plugin:jar:2.3.0 does not exist in the maven repo.

我将其更改为3.0.0.RC1,现在可以正常使用了.对于Karaf 3.x,此解决方案是可以的.

I changed it to 3.0.0.RC1, and now it works well. This solution is OK for Karaf 3.x.

对于Karaf 2.x,问题实际上出在包装上. pom 可以使用 http://karaf.apache.org/manual/latest-2.x/developers-guide/features-maven-plugin-generate.html .

For Karaf 2.x, the problem was really with the packaging. pom is fine with http://karaf.apache.org/manual/latest-2.x/developers-guide/features-maven-plugin-generate.html.

但是: features-maven-plugingenerate-features-xml目前不起作用,产生的特征文件为空".请参阅相关问题.

BUT: the features-maven-plugin's generate-features-xml does not work at this time, the produced features file is "empty". See the related issue.

这篇关于如何生成Karaf特征描述符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-20 19:29