You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Ioannis Canellos <io...@gmail.com> on 2013/01/30 12:11:22 UTC

[DISCUSS] 3rd party Karaf commands compatibility between 2.x and 3.x

I am not sure if this is still the case, so please forgive me if the
problem no longer applies, but it seems that all 3rd party projects that
provide Karaf commands, can't possibly have a bundle that will work both
2.x and 3.x.

This is mostly due to the fact that in 3.x we no longer provide or use the
gogo annotations for commands, options and arguments. Unless we manage to
solve this one, all projects that provide integration with the karaf shell
would need to rewrite their commands for 3.x, which is a bit annoying if
not frustrating.

So, I was wondering:

is it still an issue?
is there a workable work around this?
are there additional issues that will totally break compatibility and thus
there is no reason to put any effort on this one?
should we rethink about dumping the gogo annotations?

-- 
*Ioannis Canellos*
*

**
Blog: http://iocanel.blogspot.com
**
Twitter: iocanel
*

Re: [DISCUSS] 3rd party Karaf commands compatibility between 2.x and 3.x

Posted by dejanb <de...@nighttale.net>.
It seems the "problem" is that we extend AbstractCommand from basic package.
If it's easier, we can refactor code to remove that dependency.



--
View this message in context: http://karaf.922171.n3.nabble.com/DISCUSS-3rd-party-Karaf-commands-compatibility-between-2-x-and-3-x-tp4027525p4027535.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: [DISCUSS] 3rd party Karaf commands compatibility between 2.x and 3.x

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Let me take a look, maybe it could be an optional import.

Regards
JB

On 01/30/2013 01:18 PM, dejanb wrote:
> Tried it, but with the same result. Looks like
>
> org.apache.felix.gogo.commands.basic
>
> package is missing in 3.0
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/DISCUSS-3rd-party-Karaf-commands-compatibility-between-2-x-and-3-x-tp4027525p4027533.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: [DISCUSS] 3rd party Karaf commands compatibility between 2.x and 3.x

Posted by dejanb <de...@nighttale.net>.
Tried it, but with the same result. Looks like 

org.apache.felix.gogo.commands.basic

package is missing in 3.0



--
View this message in context: http://karaf.922171.n3.nabble.com/DISCUSS-3rd-party-Karaf-commands-compatibility-between-2-x-and-3-x-tp4027525p4027533.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: [DISCUSS] 3rd party Karaf commands compatibility between 2.x and 3.x

Posted by dejanb <de...@nighttale.net>.
Thanks JB, let me give it a try!



--
View this message in context: http://karaf.922171.n3.nabble.com/DISCUSS-3rd-party-Karaf-commands-compatibility-between-2-x-and-3-x-tp4027525p4027531.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: [DISCUSS] 3rd party Karaf commands compatibility between 2.x and 3.x

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

Your commands bundle should have in dependency:

<dependency>
	<groupId>org.apache.karaf.shell</groupId><artifactId>org.apache.karaf.shell.console</artifactId>	<version>2.2.9</version>
</dependency>

and in the maven-bundle-plugin configuration:

<Import-Package>
               org.apache.felix.service.command;version="[0.6,1)",
               org.apache.felix.gogo.commands;version="[0.6,1)",
               org.apache.karaf.shell.console;version="[2.2,4)",
               *
</Import-Package>

Like this, it will work with Karaf 2.2.x, 2.3.x, and trunk.

Regards
JB

On 01/30/2013 12:38 PM, dejanb wrote:
> Hi,
>
> I'm having the said problem trying to test activemq features in 3.0. I'm
> getting
>
> Error executing command: Could not start bundle
> mvn:org.apache.activemq/activemq-karaf/5.8-SNAPSHOT in feature(s)
> activemq-broker-5.8-SNAPSHOT: Unresolved constraint in bundle activemq-karaf
> [108]: Unable to resolve 108.0: missing requirement [108.0]
> osgi.wiring.package;
> (&(osgi.wiring.package=org.apache.felix.gogo.commands.basic)(version>=0.10.0)(!(version>=1.0.0)))
>
> Is there anything I need to add to the feature to be sure it will work both
> in 2.x and 3.x?
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/DISCUSS-3rd-party-Karaf-commands-compatibility-between-2-x-and-3-x-tp4027525p4027529.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: [DISCUSS] 3rd party Karaf commands compatibility between 2.x and 3.x

Posted by dejanb <de...@nighttale.net>.
Hi,

I'm having the said problem trying to test activemq features in 3.0. I'm
getting 

Error executing command: Could not start bundle
mvn:org.apache.activemq/activemq-karaf/5.8-SNAPSHOT in feature(s)
activemq-broker-5.8-SNAPSHOT: Unresolved constraint in bundle activemq-karaf
[108]: Unable to resolve 108.0: missing requirement [108.0]
osgi.wiring.package;
(&(osgi.wiring.package=org.apache.felix.gogo.commands.basic)(version>=0.10.0)(!(version>=1.0.0)))

Is there anything I need to add to the feature to be sure it will work both
in 2.x and 3.x?




--
View this message in context: http://karaf.922171.n3.nabble.com/DISCUSS-3rd-party-Karaf-commands-compatibility-between-2-x-and-3-x-tp4027525p4027529.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: [DISCUSS] 3rd party Karaf commands compatibility between 2.x and 3.x

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Yeah, because CXF directly use gogo annotations.

The opposite doesn't work: if you use Karaf annotations, it will only 
work on Karaf 3.0.0, not on previous Karaf version (2.3.x or 2.2.x).

That's the point, and I don't have solutions for that unfortunately.

Regards
JB

On 01/30/2013 12:18 PM, Christoph Gritschenberger wrote:
> At least CXF karaf-commands work just fine in both karaf 2.x and trunk
>
> kind regards,
> christoph
>
> On 2013-01-30 12:16, Jean-Baptiste Onofré wrote:
>> Hi Ioannis,
>>
>> The "problem" is there, but I don't consider as a problem, just a
>> change ;)
>>
>> For instance, the annotations (like @Command) are no more provided by
>> gogo but directly by Karaf (like
>> org.apache.karaf.shell.commands.Command).
>>
>> But, if a 3rd party application uses gogo annotation, it should still
>> work in Karaf as Karaf still use gogo runtime (I have to check).
>>
>> Let me take a look.
>>
>> Regards
>> JB
>>
>> On 01/30/2013 12:11 PM, Ioannis Canellos wrote:
>>> I am not sure if this is still the case, so please forgive me if the
>>> problem no longer applies, but it seems that all 3rd party projects that
>>> provide Karaf commands, can't possibly have a bundle that will work both
>>> 2.x and 3.x.
>>>
>>> This is mostly due to the fact that in 3.x we no longer provide or use
>>> the
>>> gogo annotations for commands, options and arguments. Unless we
>>> manage to
>>> solve this one, all projects that provide integration with the karaf
>>> shell
>>> would need to rewrite their commands for 3.x, which is a bit annoying if
>>> not frustrating.
>>>
>>> So, I was wondering:
>>>
>>> is it still an issue?
>>> is there a workable work around this?
>>> are there additional issues that will totally break compatibility and
>>> thus
>>> there is no reason to put any effort on this one?
>>> should we rethink about dumping the gogo annotations?
>>>
>>
>
>

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

Re: [DISCUSS] 3rd party Karaf commands compatibility between 2.x and 3.x

Posted by Christoph Gritschenberger <ch...@gmail.com>.
At least CXF karaf-commands work just fine in both karaf 2.x and trunk

kind regards,
christoph

On 2013-01-30 12:16, Jean-Baptiste Onofré wrote:
> Hi Ioannis,
>
> The "problem" is there, but I don't consider as a problem, just a change ;)
>
> For instance, the annotations (like @Command) are no more provided by
> gogo but directly by Karaf (like org.apache.karaf.shell.commands.Command).
>
> But, if a 3rd party application uses gogo annotation, it should still
> work in Karaf as Karaf still use gogo runtime (I have to check).
>
> Let me take a look.
>
> Regards
> JB
>
> On 01/30/2013 12:11 PM, Ioannis Canellos wrote:
>> I am not sure if this is still the case, so please forgive me if the
>> problem no longer applies, but it seems that all 3rd party projects that
>> provide Karaf commands, can't possibly have a bundle that will work both
>> 2.x and 3.x.
>>
>> This is mostly due to the fact that in 3.x we no longer provide or use
>> the
>> gogo annotations for commands, options and arguments. Unless we manage to
>> solve this one, all projects that provide integration with the karaf
>> shell
>> would need to rewrite their commands for 3.x, which is a bit annoying if
>> not frustrating.
>>
>> So, I was wondering:
>>
>> is it still an issue?
>> is there a workable work around this?
>> are there additional issues that will totally break compatibility and
>> thus
>> there is no reason to put any effort on this one?
>> should we rethink about dumping the gogo annotations?
>>
>



Re: [DISCUSS] 3rd party Karaf commands compatibility between 2.x and 3.x

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

The "problem" is there, but I don't consider as a problem, just a change ;)

For instance, the annotations (like @Command) are no more provided by 
gogo but directly by Karaf (like org.apache.karaf.shell.commands.Command).

But, if a 3rd party application uses gogo annotation, it should still 
work in Karaf as Karaf still use gogo runtime (I have to check).

Let me take a look.

Regards
JB

On 01/30/2013 12:11 PM, Ioannis Canellos wrote:
> I am not sure if this is still the case, so please forgive me if the
> problem no longer applies, but it seems that all 3rd party projects that
> provide Karaf commands, can't possibly have a bundle that will work both
> 2.x and 3.x.
>
> This is mostly due to the fact that in 3.x we no longer provide or use the
> gogo annotations for commands, options and arguments. Unless we manage to
> solve this one, all projects that provide integration with the karaf shell
> would need to rewrite their commands for 3.x, which is a bit annoying if
> not frustrating.
>
> So, I was wondering:
>
> is it still an issue?
> is there a workable work around this?
> are there additional issues that will totally break compatibility and thus
> there is no reason to put any effort on this one?
> should we rethink about dumping the gogo annotations?
>

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

Re: [DISCUSS] 3rd party Karaf commands compatibility between 2.x and 3.x

Posted by Ioannis Canellos <io...@gmail.com>.
Since there is a way of having commands to work both in 2.x and 3.x then I
am totally ok with that.
-- 
*Ioannis Canellos*
*

**
Blog: http://iocanel.blogspot.com
**
Twitter: iocanel
*

Re: [DISCUSS] 3rd party Karaf commands compatibility between 2.x and 3.x

Posted by Christian Schneider <ch...@die-schneider.net>.
It is possible to make commands work in karaf 2 and 3.
Just take a look at the cxf and camel commands. Some time ago we adapted 
them to make sure they are prepared for the new karaf.

Christian

Am 30.01.2013 12:11, schrieb Ioannis Canellos:
> I am not sure if this is still the case, so please forgive me if the
> problem no longer applies, but it seems that all 3rd party projects that
> provide Karaf commands, can't possibly have a bundle that will work both
> 2.x and 3.x.
>
> This is mostly due to the fact that in 3.x we no longer provide or use the
> gogo annotations for commands, options and arguments. Unless we manage to
> solve this one, all projects that provide integration with the karaf shell
> would need to rewrite their commands for 3.x, which is a bit annoying if
> not frustrating.
>
> So, I was wondering:
>
> is it still an issue?
> is there a workable work around this?
> are there additional issues that will totally break compatibility and thus
> there is no reason to put any effort on this one?
> should we rethink about dumping the gogo annotations?
>


-- 
  
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com