How to generate a Karaf features descriptor

落花浮王杯 提交于 2019-12-13 02:47:20

问题


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

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

my 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>

But mvn clean install complains:

Unknown packaging: feature

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


回答1:


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

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

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.

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.



来源:https://stackoverflow.com/questions/19793142/how-to-generate-a-karaf-features-descriptor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!