Hi

Do you have the karaf service plugin in your pom ?
It's this plugin which converts annotations to services.
Take a look on the karaf-command-example.

Regards
JB

Le 25 janv. 2020 18:55, Steinar Bang <s...@dod.no> a écrit :

What's needed to make karaf pick up a command?

Is it enough to annotate a class implementing the Action interface and
annotate it with the @Command and @Service annotations, and then load
the bundle that contains the class?

Or are there special considerations to make:

The class should not reside in a bundle that does other things  commands?

The package containing the classes should be exported from the bundle?

The command classes should be mentioned in the manifest?

Should the command classes be handled specially in the karaf feature file?

I think at some point this command worked, but it is no longer available
even when the bundle that contains the command is loaded:
https://github.com/steinarb/ukelonn/blob/master/ukelonn.backend/src/main/java/no/priv/bang/ukelonn/backend/KarafReleaseLiquibaseLockCommand.java#L30

Can anyone spot what might be wrong? (I haven't done anything special
except for adding the class to a bundle that is loaded by a feature and
start a DS component)

Thanks!


Reply via email to