Search code examples
apache-karafkaraf

Can I avoid typing feature:repo-add camel 2.17.3 and have the features.xml file make this happen automatically?


In Apache Karaf, before I install my features.xml file I need to type.

feature:repo-add camel 2.17.3

Is there any way to express in the features.xml file some command which makes this occur ? So that I can avoid typing it on the command line inside Karaf.

The motivation for this question is that it is nice that generally when I add a features.xml file to the deploy directory of Karaf that it can pull down all the dependent bundles by itself automatically. I like the fact that it has this automatic feature and the only thing I need to send is the features.xml. So this leads to my desire to encapsulate all the work in the features.xml file so that I do not need to type anything into the Karaf console.


Solution

  • This works. You need to refer to the camel feature xml using the repository tag. See the cxf-dosgi samples feature xml.

    The repository xml tag must appear within the features XML tag. So its like:

    <?xml version="1.0" encoding="UTF-8"?>
    <features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0" name="jump_micro">
        <repository>mvn:org.apache.camel.karaf/apache-camel/2.17.3/xml/features</repository>
        <feature description="jump_micro" version="1.0.0" name="jump_micro">
    ...