You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Aki Yoshida <el...@gmail.com> on 2015/03/18 01:09:41 UTC

Using two features in one feature while requiring some version constraints

I wanted to write a single karaf feature file to do the equivalent of
the following command steps:

feature:repo-add cxf 2.7.15
feature:install cxf
feature:repo-add camel 2.14.2
feature:install camel-cxf
install mvn:temp.com/foo/0.0.1

This will setup my karaf 3.0.3 system with cxf 2.7.15 and camel 2.14.2
to run my foo bundle.

To this using a single feature file, I thought I could write the
following feature file
.
<features ...>
  <repository>mvn:org.apache.cxf.karaf/apache-cxf/2.7.15/xml/features</repository>
  <repository>mvn:org.apache.camel.karaf/apache-camel/2.14.2/xml/features</repository>

  <feature name="my-foo" version="0.0.1" resolver="(obr)">
    <feature version="2.7.15">cxf</feature>
    <feature version="2.14.2">camel-cxf</feature>
    <bundle>mvn:temp.com/foo/0.0.1</bundle>
  </feature>
</features>

and just run
feature:install my-foo

However, this didn't work as adding camel-feature repo 2.14.2 in my
feature file is bringing cxf-feature repo 3.0.4. Consequently,
installing my-foo is pulling cxf 3.0.4 instead of cxf 2.7.15.

I tried using <feature version="]2.7,3)">cxf</feature> in my my-foo
feature, but that didn't help either

So I am wondering if there is a simple way to exclude a repo version
referenced in one feature?

Thanks
aki

Re: Using two features in one feature while requiring some version constraints

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

My bad. Let me improve the version range support in features/repos.

Regards
JB

On 03/18/2015 01:46 PM, Aki Yoshida wrote:
> Hi JB,
> thanks for the info. But I am not sure if I understood your suggested
> workaround.
>
> I tried adding the two repos to featureRepositories in
> org.apache.karaf.features.cfg. But that made the situation even worse
> and running just "feature:install my-cxf" is ignoring the range and
> installing cxf-3.0.4.
>
> Regards, aki
>
> 2015-03-18 12:58 GMT+01:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
>> It's a know issue.
>>
>> A possible workaround would be to define the features repo in
>> etc/org.apache.karaf.features.cfg instead of the features.xml.
>>
>> I will fix that asap.
>>
>> Regards
>> JB
>>
>>
>> On 03/18/2015 01:09 AM, Aki Yoshida wrote:
>>>
>>> I wanted to write a single karaf feature file to do the equivalent of
>>> the following command steps:
>>>
>>> feature:repo-add cxf 2.7.15
>>> feature:install cxf
>>> feature:repo-add camel 2.14.2
>>> feature:install camel-cxf
>>> install mvn:temp.com/foo/0.0.1
>>>
>>> This will setup my karaf 3.0.3 system with cxf 2.7.15 and camel 2.14.2
>>> to run my foo bundle.
>>>
>>> To this using a single feature file, I thought I could write the
>>> following feature file
>>> .
>>> <features ...>
>>>
>>> <repository>mvn:org.apache.cxf.karaf/apache-cxf/2.7.15/xml/features</repository>
>>>
>>> <repository>mvn:org.apache.camel.karaf/apache-camel/2.14.2/xml/features</repository>
>>>
>>>     <feature name="my-foo" version="0.0.1" resolver="(obr)">
>>>       <feature version="2.7.15">cxf</feature>
>>>       <feature version="2.14.2">camel-cxf</feature>
>>>       <bundle>mvn:temp.com/foo/0.0.1</bundle>
>>>     </feature>
>>> </features>
>>>
>>> and just run
>>> feature:install my-foo
>>>
>>> However, this didn't work as adding camel-feature repo 2.14.2 in my
>>> feature file is bringing cxf-feature repo 3.0.4. Consequently,
>>> installing my-foo is pulling cxf 3.0.4 instead of cxf 2.7.15.
>>>
>>> I tried using <feature version="]2.7,3)">cxf</feature> in my my-foo
>>> feature, but that didn't help either
>>>
>>> So I am wondering if there is a simple way to exclude a repo version
>>> referenced in one feature?
>>>
>>> Thanks
>>> aki
>>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com

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

Re: Using two features in one feature while requiring some version constraints

Posted by Aki Yoshida <el...@gmail.com>.
Hi JB,
thanks for the info. But I am not sure if I understood your suggested
workaround.

I tried adding the two repos to featureRepositories in
org.apache.karaf.features.cfg. But that made the situation even worse
and running just "feature:install my-cxf" is ignoring the range and
installing cxf-3.0.4.

Regards, aki

2015-03-18 12:58 GMT+01:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
> It's a know issue.
>
> A possible workaround would be to define the features repo in
> etc/org.apache.karaf.features.cfg instead of the features.xml.
>
> I will fix that asap.
>
> Regards
> JB
>
>
> On 03/18/2015 01:09 AM, Aki Yoshida wrote:
>>
>> I wanted to write a single karaf feature file to do the equivalent of
>> the following command steps:
>>
>> feature:repo-add cxf 2.7.15
>> feature:install cxf
>> feature:repo-add camel 2.14.2
>> feature:install camel-cxf
>> install mvn:temp.com/foo/0.0.1
>>
>> This will setup my karaf 3.0.3 system with cxf 2.7.15 and camel 2.14.2
>> to run my foo bundle.
>>
>> To this using a single feature file, I thought I could write the
>> following feature file
>> .
>> <features ...>
>>
>> <repository>mvn:org.apache.cxf.karaf/apache-cxf/2.7.15/xml/features</repository>
>>
>> <repository>mvn:org.apache.camel.karaf/apache-camel/2.14.2/xml/features</repository>
>>
>>    <feature name="my-foo" version="0.0.1" resolver="(obr)">
>>      <feature version="2.7.15">cxf</feature>
>>      <feature version="2.14.2">camel-cxf</feature>
>>      <bundle>mvn:temp.com/foo/0.0.1</bundle>
>>    </feature>
>> </features>
>>
>> and just run
>> feature:install my-foo
>>
>> However, this didn't work as adding camel-feature repo 2.14.2 in my
>> feature file is bringing cxf-feature repo 3.0.4. Consequently,
>> installing my-foo is pulling cxf 3.0.4 instead of cxf 2.7.15.
>>
>> I tried using <feature version="]2.7,3)">cxf</feature> in my my-foo
>> feature, but that didn't help either
>>
>> So I am wondering if there is a simple way to exclude a repo version
>> referenced in one feature?
>>
>> Thanks
>> aki
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com

Re: Using two features in one feature while requiring some version constraints

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
It's a know issue.

A possible workaround would be to define the features repo in 
etc/org.apache.karaf.features.cfg instead of the features.xml.

I will fix that asap.

Regards
JB

On 03/18/2015 01:09 AM, Aki Yoshida wrote:
> I wanted to write a single karaf feature file to do the equivalent of
> the following command steps:
>
> feature:repo-add cxf 2.7.15
> feature:install cxf
> feature:repo-add camel 2.14.2
> feature:install camel-cxf
> install mvn:temp.com/foo/0.0.1
>
> This will setup my karaf 3.0.3 system with cxf 2.7.15 and camel 2.14.2
> to run my foo bundle.
>
> To this using a single feature file, I thought I could write the
> following feature file
> .
> <features ...>
>    <repository>mvn:org.apache.cxf.karaf/apache-cxf/2.7.15/xml/features</repository>
>    <repository>mvn:org.apache.camel.karaf/apache-camel/2.14.2/xml/features</repository>
>
>    <feature name="my-foo" version="0.0.1" resolver="(obr)">
>      <feature version="2.7.15">cxf</feature>
>      <feature version="2.14.2">camel-cxf</feature>
>      <bundle>mvn:temp.com/foo/0.0.1</bundle>
>    </feature>
> </features>
>
> and just run
> feature:install my-foo
>
> However, this didn't work as adding camel-feature repo 2.14.2 in my
> feature file is bringing cxf-feature repo 3.0.4. Consequently,
> installing my-foo is pulling cxf 3.0.4 instead of cxf 2.7.15.
>
> I tried using <feature version="]2.7,3)">cxf</feature> in my my-foo
> feature, but that didn't help either
>
> So I am wondering if there is a simple way to exclude a repo version
> referenced in one feature?
>
> Thanks
> aki
>

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

Re: Using two features in one feature while requiring some version constraints

Posted by Andreas Kuhtz <an...@gmail.com>.
Hi,

I think I had the same issue a time ago and I've created
https://issues.apache.org/jira/browse/KARAF-3053 ...

Hope this helps.

Regards,
Andreas

2015-03-18 11:08 GMT+01:00 Aki Yoshida <el...@gmail.com>:

> Hi,
> I think there is something strange and need to place my question again.
>
> I  created a small test and verified that this problem occurs under a
> specific case.
>
> When I have a feature file
> <features ...>
>
> <repository>mvn:org.apache.cxf.karaf/apache-cxf/2.7.15/xml/features</repository>
>
> <repository>mvn:org.apache.camel.karaf/apache-camel/2.14.2/xml/features</repository>
>
>   <feature name="my-cxf" version="0.0.1" resolver="(obr)">
>     <feature version="[2.7,3)">cxf</feature>
>   </feature>
>
>   <feature name="my-camel" version="${project.version}" resolver="(obr)">
>     <feature version="2.14.2">camel-cxf</feature>
>   </feature>
>
>   <feature name="my-cxf-and-camel" version="${project.version}"
> resolver="(obr)">
>     <feature version="[2.7,3)">cxf</feature>
>     <feature version="2.14.2">camel-cxf</feature>
>   </feature>
> </features>
>
> when I run
> feature:install my-cxf
> feature:install my-camel
>
> I get a system with cxf-2.7.15 and camel-2.14.2. Everything is fine.
>
> but when I run
> feature:install my-cxf-and-camel
>
> I get a system with mixed cxf-2.7.15 and cxf-3.0.4 and camel-2.14.2
>
> I am not sure if I am missing something there?
>
> regards, aki
>
> 2015-03-18 10:37 GMT+01:00 Aki Yoshida <el...@gmail.com>:
> > maybe I was doing something wrong yesterday.
> > it is working fine with setting the range at the feature.
> > sorry. please ignore my message.
> > regards, aki
> >
> > 2015-03-18 1:09 GMT+01:00 Aki Yoshida <el...@gmail.com>:
> >> I wanted to write a single karaf feature file to do the equivalent of
> >> the following command steps:
> >>
> >> feature:repo-add cxf 2.7.15
> >> feature:install cxf
> >> feature:repo-add camel 2.14.2
> >> feature:install camel-cxf
> >> install mvn:temp.com/foo/0.0.1
> >>
> >> This will setup my karaf 3.0.3 system with cxf 2.7.15 and camel 2.14.2
> >> to run my foo bundle.
> >>
> >> To this using a single feature file, I thought I could write the
> >> following feature file
> >> .
> >> <features ...>
> >>
>  <repository>mvn:org.apache.cxf.karaf/apache-cxf/2.7.15/xml/features</repository>
> >>
>  <repository>mvn:org.apache.camel.karaf/apache-camel/2.14.2/xml/features</repository>
> >>
> >>   <feature name="my-foo" version="0.0.1" resolver="(obr)">
> >>     <feature version="2.7.15">cxf</feature>
> >>     <feature version="2.14.2">camel-cxf</feature>
> >>     <bundle>mvn:temp.com/foo/0.0.1</bundle>
> >>   </feature>
> >> </features>
> >>
> >> and just run
> >> feature:install my-foo
> >>
> >> However, this didn't work as adding camel-feature repo 2.14.2 in my
> >> feature file is bringing cxf-feature repo 3.0.4. Consequently,
> >> installing my-foo is pulling cxf 3.0.4 instead of cxf 2.7.15.
> >>
> >> I tried using <feature version="]2.7,3)">cxf</feature> in my my-foo
> >> feature, but that didn't help either
> >>
> >> So I am wondering if there is a simple way to exclude a repo version
> >> referenced in one feature?
> >>
> >> Thanks
> >> aki
>

Re: Using two features in one feature while requiring some version constraints

Posted by Aki Yoshida <el...@gmail.com>.
Hi,
I think there is something strange and need to place my question again.

I  created a small test and verified that this problem occurs under a
specific case.

When I have a feature file
<features ...>
  <repository>mvn:org.apache.cxf.karaf/apache-cxf/2.7.15/xml/features</repository>
  <repository>mvn:org.apache.camel.karaf/apache-camel/2.14.2/xml/features</repository>

  <feature name="my-cxf" version="0.0.1" resolver="(obr)">
    <feature version="[2.7,3)">cxf</feature>
  </feature>

  <feature name="my-camel" version="${project.version}" resolver="(obr)">
    <feature version="2.14.2">camel-cxf</feature>
  </feature>

  <feature name="my-cxf-and-camel" version="${project.version}"
resolver="(obr)">
    <feature version="[2.7,3)">cxf</feature>
    <feature version="2.14.2">camel-cxf</feature>
  </feature>
</features>

when I run
feature:install my-cxf
feature:install my-camel

I get a system with cxf-2.7.15 and camel-2.14.2. Everything is fine.

but when I run
feature:install my-cxf-and-camel

I get a system with mixed cxf-2.7.15 and cxf-3.0.4 and camel-2.14.2

I am not sure if I am missing something there?

regards, aki

2015-03-18 10:37 GMT+01:00 Aki Yoshida <el...@gmail.com>:
> maybe I was doing something wrong yesterday.
> it is working fine with setting the range at the feature.
> sorry. please ignore my message.
> regards, aki
>
> 2015-03-18 1:09 GMT+01:00 Aki Yoshida <el...@gmail.com>:
>> I wanted to write a single karaf feature file to do the equivalent of
>> the following command steps:
>>
>> feature:repo-add cxf 2.7.15
>> feature:install cxf
>> feature:repo-add camel 2.14.2
>> feature:install camel-cxf
>> install mvn:temp.com/foo/0.0.1
>>
>> This will setup my karaf 3.0.3 system with cxf 2.7.15 and camel 2.14.2
>> to run my foo bundle.
>>
>> To this using a single feature file, I thought I could write the
>> following feature file
>> .
>> <features ...>
>>   <repository>mvn:org.apache.cxf.karaf/apache-cxf/2.7.15/xml/features</repository>
>>   <repository>mvn:org.apache.camel.karaf/apache-camel/2.14.2/xml/features</repository>
>>
>>   <feature name="my-foo" version="0.0.1" resolver="(obr)">
>>     <feature version="2.7.15">cxf</feature>
>>     <feature version="2.14.2">camel-cxf</feature>
>>     <bundle>mvn:temp.com/foo/0.0.1</bundle>
>>   </feature>
>> </features>
>>
>> and just run
>> feature:install my-foo
>>
>> However, this didn't work as adding camel-feature repo 2.14.2 in my
>> feature file is bringing cxf-feature repo 3.0.4. Consequently,
>> installing my-foo is pulling cxf 3.0.4 instead of cxf 2.7.15.
>>
>> I tried using <feature version="]2.7,3)">cxf</feature> in my my-foo
>> feature, but that didn't help either
>>
>> So I am wondering if there is a simple way to exclude a repo version
>> referenced in one feature?
>>
>> Thanks
>> aki

Re: Using two features in one feature while requiring some version constraints

Posted by Aki Yoshida <el...@gmail.com>.
maybe I was doing something wrong yesterday.
it is working fine with setting the range at the feature.
sorry. please ignore my message.
regards, aki

2015-03-18 1:09 GMT+01:00 Aki Yoshida <el...@gmail.com>:
> I wanted to write a single karaf feature file to do the equivalent of
> the following command steps:
>
> feature:repo-add cxf 2.7.15
> feature:install cxf
> feature:repo-add camel 2.14.2
> feature:install camel-cxf
> install mvn:temp.com/foo/0.0.1
>
> This will setup my karaf 3.0.3 system with cxf 2.7.15 and camel 2.14.2
> to run my foo bundle.
>
> To this using a single feature file, I thought I could write the
> following feature file
> .
> <features ...>
>   <repository>mvn:org.apache.cxf.karaf/apache-cxf/2.7.15/xml/features</repository>
>   <repository>mvn:org.apache.camel.karaf/apache-camel/2.14.2/xml/features</repository>
>
>   <feature name="my-foo" version="0.0.1" resolver="(obr)">
>     <feature version="2.7.15">cxf</feature>
>     <feature version="2.14.2">camel-cxf</feature>
>     <bundle>mvn:temp.com/foo/0.0.1</bundle>
>   </feature>
> </features>
>
> and just run
> feature:install my-foo
>
> However, this didn't work as adding camel-feature repo 2.14.2 in my
> feature file is bringing cxf-feature repo 3.0.4. Consequently,
> installing my-foo is pulling cxf 3.0.4 instead of cxf 2.7.15.
>
> I tried using <feature version="]2.7,3)">cxf</feature> in my my-foo
> feature, but that didn't help either
>
> So I am wondering if there is a simple way to exclude a repo version
> referenced in one feature?
>
> Thanks
> aki