Jump to: navigation, search

Karaf:How to create a configfile project for Karaf

Intro

If you have been following the instructions in Karaf Step by Step Guide#Edit_the_features/pom.xml you may have realized in the TODOs that you need to have some <configfiles> for your feature. This is particularly true if you are wiring up for the config subsystem.

In order to be able to reference your <configfile> you need to have it available as a maven accessible artifact. Not in a jar, but the file itself.

For that you will need a new maven project for your config file.

Create a configfile project

Run the opendaylight-configfile-archetype

mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-configfile-archetype -DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ -DarchetypeCatalog=http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/archetype-catalog.xml

You will be prompted for

groupId: (enter your project groupId)
artifactId: ${repoName}-config
version: (version of your project)
package: (accept default)
repoName: (your projects repoName, examples: controller, yangtools, openflowplugin)

Edit the ${repoName}-config/pom.xml

Edit the

${repoName}-config/pom.xml

find the TODO items, and do them :)