OK, you use the bundle packaging. I thought you use scope=bundle for your command.

1/ I don't see the karaf-services-maven-plugin in your pom.
2/ If you don't use the karaf-services-maven-plugin (that use your @Service annotation), you have to register the command services in an Activator

So, if you add:

            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-services-maven-plugin</artifactId>
                <version>4.0.0.M2</version>
            </plugin>

in the <build/> section of your pom, it should work (the plugin will create the command services registration).

Regards
JB

On 03/17/2015 04:24 PM, rcbandit wrote:
I don't understand the question.

This is the POM file:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
     <modelVersion>4.0.0</modelVersion>

     <groupId>Commands_Kerneldddd</groupId>
     <artifactId>Commands_custom</artifactId>
     <name>Commands_custom</name>
     <description>Module Commands_Kernel</description>
     <version>1.0</version>

     <dependencies>

         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
             <version>5.0.0</version>
             <type>jar</type>
         </dependency>

         <dependency>
             <groupId>org.apache.karaf.shell</groupId>
             <artifactId>org.apache.karaf.shell.core</artifactId>
             <version>4.0.0.M2</version>
             <scope>provided</scope>
         </dependency>

     </dependencies>

     <build>
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <version>2.5.3</version>
                 <configuration>
                     <instructions>
                         <Karaf-Commands>*</Karaf-Commands>
                     </instructions>
                 </configuration>
             </plugin>
         </plugins>
     </build>

</project>




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Cannot-run-commands-in-Karaf-4-0-0-M2-tp4039115p4039126.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.


--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to