Skip to main content Skip to complementary content

Commands

Repository management

The following commands can be used to manage the list of descriptors known by Karaf. They use URLs pointing to features descriptors. These URLs can use any protocol known to Apache Karaf, the most common ones being http, file and mvn.

  • feature:repo-add: Add a list of repository URLs to the features service

  • feature:repo-remove: Remove a list of repository URLs from the features service

  • feature:repo-list: Display the repository URLs currently associated with the features service.

  • feature:repo-refresh: Reload the repositories to obtain a fresh list of features

Karaf maintains a persistent list of these repositories so that if you add one URL and restart Karaf, the features will still be available. The repo-refresh command is mostly used when developing features descriptors: when changing the descriptor, it can be handy to reload it in the Kernel without having to restart it or to remove then add again this URL.

Features management

Common feature: scope commands used in features management include feature:install, feature:uninstall, and feature:list. See Feature Scope for more information on these commands.

Command examples

To install features using mvn handler:

feature:repo-add mvn:org.apache.servicemix.nmr/apache-servicemix-nmr/1.0.0-m2/xml/features
            feature:install nmr

To use a file handler to deploy a features file (note the path is relative to the Apache Karaf installation directory):

feature:repo-add file:base/features/features.xml

To deploy bundles from file system without using Maven: As we can use file:// as protocol handler to deploy bundles, you can use the following syntax to deploy bundles when they are located in a directory which is not available using Maven:

<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0">
            <feature name="spring-web" version="2.5.6.SEC01">
            <bundle>file:base/bundles/spring-web-2.5.6.SEC01.jar</bundle>
            </feature>
            </features>

Note the path again is relative to Apache Karaf installation directory.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!