cxfkaraf

In Karaf's feature.xml, is it possible to add a repo?


I am wanting to have the equivalent of this karaf command:

feature:add-repo mvn:org.apache.cxf.karaf/apache-cxf/3.3.1/xml/features

The bigger picture is that I want to be able to have a clean karaf install, copy a .kar file to the deploy folder, and have it download and install all of the features defined in feature.xml.

Currently, I have a feature.xml that lists the required features, but cxf is not in the pre-configured repos. For my testing, I have added the repo to org.apache.karaf.features.cfg.

I tried using the <library> element, but that doesn't appear to do this.

(My work is based on the karaf-jpa-example.)

thanks


Solution

  • If I got what you are trying to do, this should do the trick:

    <features name="${project.artifactId}-${project.version}"
        xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
    
        <repository>mvn:org.apache.cxf.karaf/apache-cxf/3.3.1/xml/features</repository>
    
        <feature name="your-feature" version="${project.version}">
            ...
        </feature>
    

    See the CXF Karaf feature project for a rich set of examples.