Sounds reasonable. Can you please file a feature request at our jira
that we don't forget about it?

Kind regards,
Andreas

On Thu, Oct 25, 2012 at 3:30 AM, XiLai Dai <xl...@talend.com> wrote:
> Hi,
> Maybe make improvement to features:install command, let it support features 
> repo name, e.g.
>     >features:install features_a/myfeature/1.0
>
> Thanks.
> Xilai
> -----Original Message-----
> From: aj...@virginia.edu [mailto:aj...@virginia.edu]
> Sent: Wednesday, October 24, 2012 7:59 PM
> To: user@karaf.apache.org
> Subject: Re: same feature name exists in multi feature repo url
>
> That's what I meant by "ordering behavior undefined". The order of search is 
> what you seem to be asking about.
>
> To my understanding (I welcome correction) it isn't defined and you just 
> shouldn't rely on it (for example, it could change between versions of 
> Karaf). If you want to make sure a certain feature is loaded and no other, 
> you have to distinguish it (by name or version) from every other. Perhaps you 
> might try using your FQDN or the like as a prefix.
>
> ---
> A. Soroka
> Software & Systems Engineering :: Online Library Environment
> the University of Virginia Library
>
> On Oct 23, 2012, at 11:03 PM, XiLai Dai wrote:
>
>> Hi,
>> My question is not about the version of feature, there is only one feature 
>> of version 1.0 (name='myfeature' version='1.0') defined in both two 
>> different features xml which I provided in the mail.
>>
>> My question is: if a feature (same name and same version) exists in multi 
>> features repo xml, and all these features urls have been installed into 
>> karaf (using features:addurl), then, when I run:
>>> features:install myfeature/1.0
>> Which one will be installed? The one from features_a xml? or the one from 
>> features_b xml?
>>
>> From the result of my test, no matter the order of features:addurl commands 
>> executed, the last one from the features:listurl will be installed into 
>> karaf.  Is it right? How to allow user to select his preferred 
>> myfeatu.re/1.0 to install?
>>
>> Thanks.
>> Xilai
>> -----Original Message-----
>> From: aj...@virginia.edu [mailto:aj...@virginia.edu]
>> Sent: Tuesday, October 23, 2012 10:01 PM
>> To: user@karaf.apache.org
>> Subject: Re: same feature name exists in multi feature repo url
>>
>> To be clear, if I understand you correctly, you're pointing out that the 
>> version attribute in feature XML _defines_ the version of the feature that 
>> the XML describes. The version of the feature that you offer when installing 
>> via Maven protocol (say, via command-line features:install) is what Karaf 
>> _searches_ for in available repositories, with ordering behavior undefined 
>> (howsoever the feature-version in Maven was defined). If you don't give a 
>> version in your install operation, it'll search for the latest non-snapshot 
>> in available repositories, with ordering behavior undefined. And just to be 
>> complete, if you use a feature version in a feature declared as a 
>> _dependency_ in feature XML, it has the second meaning.
>>
>> Is that right? Two different meanings, the first of which (defining the 
>> feature version) _only_ applies to the attribute in XML?
>>
>> ---
>> A. Soroka
>> Software & Systems Engineering :: Online Library Environment
>> the University of Virginia Library
>>
>> On Oct 23, 2012, at 9:50 AM, Andreas Pieber wrote:
>>
>>> Well, since you're using the mvn (maven) Protokoll this need to be 
>>> installed at least in your lokal maven repository. The version of the 
>>> features you've defined in the xml is of NO relevance here. Only the 
>>> version you've given it in your maven repo is relevant. For starting using 
>>> the file: protocol, directly pointing to your features in your file system 
>>> might be the easier option. You can still switch to mvn there once you get 
>>> familiar with the concepts.
>>>
>>> Kind regards, Andreas
>>>
>>> On Oct 23, 2012 5:36 AM, "XiLai Dai" <xl...@talend.com> wrote:
>>> Hi,
>>>
>>>
>>>
>>> One feature xml named feature-a-1.0
>>>
>>>
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>>
>>> <features name="feature_a" 
>>> xmlns="http://karaf.apache.org/xmlns/features/v1.0.0";>
>>>
>>>
>>>
>>>  <feature name='myfeature' version='1.0'>
>>>
>>>    
>>> <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jdom/1.1_4</bundle>
>>>
>>>  </feature>
>>>
>>>
>>>
>>> </features>
>>>
>>>
>>>
>>> The other feature xml named feature-b-1.0
>>>
>>>
>>>
>>> <features name="feature_b" 
>>> xmlns="http://karaf.apache.org/xmlns/features/v1.0.0";>
>>>
>>>
>>>
>>>  <feature name='myfeature' version='1.0'>
>>>
>>>     <bundle>mvn:commons-dbcp/commons-dbcp/1.4</bundle>
>>>
>>>  </feature>
>>>
>>>
>>>
>>> </features>
>>>
>>>
>>>
>>> Both of them have a feature named "myfeature"/"1.0". then add feature url 
>>> to karaf:
>>>
>>>
>>>
>>> karaf@root>features:addurl mvn:org.test/features_a/1.0/xml
>>>
>>> karaf@root>features:addurl mvn:org.test/features_b/1.0/xml
>>>
>>>
>>>
>>> then install myfeature:  karaf@root>features:install myfeature
>>>
>>>
>>>
>>> which is the expected search order for myfeature?  I did some test but 
>>> sometimes myfeature which from the first features xml installed, sometimes 
>>> from the second features.
>>>
>>>
>>>
>>> Thanks.
>>>
>>> Xilai
>>>
>>
>

Reply via email to