Every step is OK without fatal errors. However, when I run distribution-karaf/target/assembly/bin/karaf, I don't find my module in the feature list (feature:list | grep zzy - I use features-zzy as artifactId).

In more detail, I get the repository by git clone https://git.opendaylight.org/gerrit/openflowplugin.git openflowplugin;. When creating the feature folder by mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-karaf-features-archetype -DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ -DarchetypeCatalog=http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/archetype-catalog.xml (from the tutorial mentioned at the beginning), I set the parameters as following:

groupId: (a random number)

artifactId: features-zzy

version: (default)

package: (default)

repoName: zzy

And as the tutorial suggested, I renamed the result folder from "features-zzy" to "features", renamed this module names inside pom file, and copied the pom.xml as well as features.xml from the sample features folder (existing in the original repository). Then I created the folder "distribution-karaf", compiled it, run distribution-karaf/target/assembly/bin/karaf and don't find my module inside karaf console.

The parameters here I used are:

groupId: (the same random number as above)

artifactId: distribution-karaf

version: (default)

package: (default)

repoName: zzy

Do I miss anything here to load my new module? Any ideas for this? I'm indeed a newbie in odl world.

2 answers

If your module built and installed successfully using mvn clean install. That mean it is available in local repository (~/.m2/repository/). Then you have to tell karaf about your module, which can be done by add repository in karaf using following karaf command:

Comments

Thank you for the reply! I've tried the command but get such error msg: "Error executing command: Error resolving artifact zzy:features-zzy:xml:features:0.1.0-SNAPSHOT: Could not find artifact zzy:features-zzy:xml:features:0.1.0-SNAPSHOT in apache (http://repository.apache.org/content/groups/snapshots-group/)".
(The same as I replied to nevalosa) - At ~/.m2, I find the folder for my feature. However, there is no .jar there, the only file is 0.1.0-SNAPSHOT/resolver-status.properties. I guess this is the reason I couldn't find the module in Karaf. I install my feature by `mvn install -DskipTests`. Do I miss anything here?

Guess, your app name is simpleapp, I m not sure about version... Following command should work:
`feature:repo-add mvn:zzy/simpleapp/features-zzy/1.0-SNAPSHOT/xml/features`
Or below should work,
`feature:repo-add mvn:zzy/simpleapp/features-zzy/0.1.0-SNAPSHOT/xml/features`

You can check whether there is any exception or warning reported when you execute under Karaf stet by step by log:tail. After install, check the directory $KARAFHOME/system (your KARAFHOME might be distribution-karaf/target/assembly) whether feature jars exist in these repository (jar path is same as maven).

Comments

Thank you! But I don't find anything useful in log - there seems to be no error there. In my $KARAFHOME/system, I find many .pom files (rather than .jar), but nothing for my module. At ~/.m2, I find the folder for my feature. However, there is no .jar there, the only file is 0.1.0-SNAPSHOT/resolver-status.properties. I guess this is the reason I couldn't find the module in Karaf. I install my feature by `mvn install -DskipTests`. Do I miss anything here?