You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by rcbandit <pe...@gmail.com> on 2015/05/14 16:37:26 UTC

Custom command for apache-karaf-4.0.0-20150507.135024-329.zip

I noticed that there is no demo of custom console command in
apache-karaf-4.0.0-20150507.135024-329.zip

I tested to create custom command in apache-karaf-4.0.0M2 and to run it on
apache-karaf-4.0.0-SNAPSHOT but the command is not found. Is this known
issue? Maybe the code is under development?



--
View this message in context: http://karaf.922171.n3.nabble.com/Custom-command-for-apache-karaf-4-0-0-20150507-135024-329-zip-tp4040353.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: Custom command for apache-karaf-4.0.0-20150507.135024-329.zip

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Let me check.

Regards
JB

On 05/14/2015 04:37 PM, rcbandit wrote:
> I noticed that there is no demo of custom console command in
> apache-karaf-4.0.0-20150507.135024-329.zip
>
> I tested to create custom command in apache-karaf-4.0.0M2 and to run it on
> apache-karaf-4.0.0-SNAPSHOT but the command is not found. Is this known
> issue? Maybe the code is under development?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Custom-command-for-apache-karaf-4-0-0-20150507-135024-329-zip-tp4040353.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Custom command for apache-karaf-4.0.0-20150507.135024-329.zip

Posted by rcbandit <pe...@gmail.com>.
I already did but the result is the same.



--
View this message in context: http://karaf.922171.n3.nabble.com/Custom-command-for-apache-karaf-4-0-0-20150507-135024-329-zip-tp4040353p4040364.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: Custom command for apache-karaf-4.0.0-20150507.135024-329.zip

Posted by Guillaume Nodet <gn...@apache.org>.
You need to add a header to the manifest
   <Karaf-Commands>*</Karaf-Commands>

This header need to contain the list of packages containing commands, but a
* will scan all packages.

2015-05-14 22:03 GMT+02:00 rcbandit <pe...@gmail.com>:

> I managed to find  the problem but I need some help.
>
> In my pom I use these instructions to import packages:
>
>                         <Import-Package>
>                             org.osgi.framework,
>                             org.osgi.util.tracker,
>                             org.apache.karaf.shell.api.action,
>                             org.apache.karaf.shell.api.console
>                         </Import-Package>
>
> It works when I import all packages:
>
>                         <Import-Package>
>                             *
>                         </Import-Package>
>
> So looks like that I need to import some package dynamically in order to
> make my command to work. Can you tell me which package I have to import?
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Custom-command-for-apache-karaf-4-0-0-20150507-135024-329-zip-tp4040353p4040361.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>

Re: Custom command for apache-karaf-4.0.0-20150507.135024-329.zip

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

you need:

                             org.apache.felix.service.command,
                             org.apache.felix.gogo.commands,
                             org.apache.karaf.shell.console;version="[3,5)",
 
org.apache.karaf.shell.console.commands;version="[3,5)",
 
org.apache.karaf.shell.console.completer;version="[3,5)",
 
org.apache.karaf.shell.commands;version="[3,5)",

imports.

Regards
JB

On 05/14/2015 10:03 PM, rcbandit wrote:
> I managed to find  the problem but I need some help.
>
> In my pom I use these instructions to import packages:
>
>                          <Import-Package>
>                              org.osgi.framework,
>                              org.osgi.util.tracker,
>                              org.apache.karaf.shell.api.action,
>                              org.apache.karaf.shell.api.console
>                          </Import-Package>
>
> It works when I import all packages:
>
>                          <Import-Package>
>                              *
>                          </Import-Package>
>
> So looks like that I need to import some package dynamically in order to
> make my command to work. Can you tell me which package I have to import?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Custom-command-for-apache-karaf-4-0-0-20150507-135024-329-zip-tp4040353p4040361.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Custom command for apache-karaf-4.0.0-20150507.135024-329.zip

Posted by rcbandit <pe...@gmail.com>.
I managed to find  the problem but I need some help.

In my pom I use these instructions to import packages:

                        <Import-Package>
                            org.osgi.framework,
                            org.osgi.util.tracker,
                            org.apache.karaf.shell.api.action,
                            org.apache.karaf.shell.api.console
                        </Import-Package>

It works when I import all packages:

                        <Import-Package>
                            *
                        </Import-Package>

So looks like that I need to import some package dynamically in order to
make my command to work. Can you tell me which package I have to import?



--
View this message in context: http://karaf.922171.n3.nabble.com/Custom-command-for-apache-karaf-4-0-0-20150507-135024-329-zip-tp4040353p4040361.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: Custom command for apache-karaf-4.0.0-20150507.135024-329.zip

Posted by Morgan Hautman <mo...@gmail.com>.
Hi,

Here should be a demo:

https://github.com/apache/karaf/tree/master/demos/command/src/main/java/org/apache/karaf/demos/command

Regards,
Morgan

On 14/05/2015 16:37, rcbandit wrote:
> I noticed that there is no demo of custom console command in
> apache-karaf-4.0.0-20150507.135024-329.zip
>
> I tested to create custom command in apache-karaf-4.0.0M2 and to run it on
> apache-karaf-4.0.0-SNAPSHOT but the command is not found. Is this known
> issue? Maybe the code is under development?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Custom-command-for-apache-karaf-4-0-0-20150507-135024-329-zip-tp4040353.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.