Here's is a test case you can build.

https://github.com/benson-basis/karaf-feature-version-tc

If you get missing bundle errors instead of missing feature, I'll trim
out all my internal bundles from the big feature.xml.



On Thu, Dec 3, 2015 at 12:38 PM, Benson Margulies <[email protected]> wrote:
> I tried another experiment. I set all my feature versions to my real,
> qualified, osgi versions.
>
> So, I start by building a feature that looks like:
>
> <features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0";
> name="rosapi-common-0.7.105.v20151203053014">
>     <feature name="rosapi-common" description="rosapi-common"
> version="0.7.105.v20151203053014">
>         <details>Code in common for Rosette API Web Service 1.5</details>
>         <feature prerequisite="false"
> dependency="false">bean-validation-support</feature>
>         <bundle>mvn:com.basistech.ws/rosapi-common/0.7.105-SNAPSHOT</bundle>
>    </feature>
>
> </features>
>
> Then, I aggregate it:
>
> <features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0";
> name="rosapi-features-0.7.105.v20151203053053">
>   <feature name="rosapi-common" description="rosapi-common"
> version="0.7.105.v20151203053014">
>         <details>Code in common for Rosette API Web Service 1.5</details>
>         <feature prerequisite="false"
> dependency="false">bean-validation-support</feature>
>         <bundle>mvn:com.basistech.ws/rosapi-common/0.7.105-SNAPSHOT</bundle>
>   </feature>
> </features>
>
> Then I try to use it in an assembly:
>
> Caused by: java.lang.IllegalStateException: Could not find matching
> feature for rosapi-common/0.7.105.v20151203053019
> at org.apache.karaf.profile.assembly.Builder.addFeatures(Builder.java:1053)
> at org.apache.karaf.profile.assembly.Builder.addFeatures(Builder.java:1046)
> at org.apache.karaf.profile.assembly.Builder.addFeatures(Builder.java:1046)
> at org.apache.karaf.profile.assembly.Builder.bootStage(Builder.java:786)
> at 
> org.apache.karaf.profile.assembly.Builder.doGenerateAssembly(Builder.java:586)
> at 
> org.apache.karaf.profile.assembly.Builder.generateAssembly(Builder.java:375)
> at org.apache.karaf.tooling.AssemblyMojo.doExecute(AssemblyMojo.java:330)
> at org.apache.karaf.tooling.AssemblyMojo.execute(AssemblyMojo.java:178)
>
> The version it's trying to use comes from _SOME OTHER FEATURE_ in the
> aggregated feature file.
>
>
>
> On Thu, Dec 3, 2015 at 9:09 AM, Jean-Baptiste Onofré <[email protected]> 
> wrote:
>> Hi Benson,
>>
>> Let me check the change what we did between 4.0.2 and 4.0.3.
>>
>> I agree with you that it should work as before.
>>
>> I keep you posted.
>>
>> Thanks,
>> Regards
>> JB
>>
>>
>> On 12/03/2015 03:07 PM, Benson Margulies wrote:
>>>
>>> The versions all got there by the karaf-maven-plugin. JB, I didn't
>>> write that version. All I wrote was <feature>rosapi-common</feature>.
>>>
>>> Let's follow the history:
>>>
>>> in the first project, src/main/feature/feature.xml says:
>>>
>>> <features name="${project.artifactId}-${project.version}"
>>> xmlns="http://karaf.apache.org/xmlns/features/v1.3.0";>
>>>      <feature name='${project.artifactId}'
>>> description='${project.name}' version='${project.version}' >
>>>          <details>${project.description}</details>
>>>          <feature>bean-validation-support</feature>
>>>      </feature>
>>> </features>
>>>
>>> Then this feature is aggregated in a second project, and a third
>>> project uses it in an assembly. And the third project is where I get
>>> the error.
>>>
>>> so, of course, it has a -SNAPSHOT version. I thought I took this from
>>> some documentation. Do I need to use an osgi-friendly version instead?
>>> That's an interesting incompatibility from 4.0.2, where all this
>>> worked.
>>>
>>>
>>> On Thu, Dec 3, 2015 at 9:00 AM, Jean-Baptiste Onofré <[email protected]>
>>> wrote:
>>>>
>>>> Your version doesn't look good (0.7.105-SNAPSHOT instead of
>>>> 0.7.105.SNAPSHOT).
>>>>
>>>> Regards
>>>> JB
>>>>
>>>>
>>>> On 12/03/2015 02:52 PM, Benson Margulies wrote:
>>>>>
>>>>>
>>>>> My assembly builds that worked in 4.0.2 don't work in 4.0.3.
>>>>>
>>>>> The error is:
>>>>>
>>>>> [ERROR] Failed to execute goal
>>>>> org.apache.karaf.tooling:karaf-maven-plugin:4.0.3:assembly
>>>>> (default-assembly) on project rosapi-assembly-min-test: Unable to
>>>>> build assembly: Could not find matching feature for
>>>>> rosapi-common/0.7.105-SNAPSHOT -> [Help 1]
>>>>>
>>>>> This comes from a pom which says:
>>>>>
>>>>>    <feature>rosapi-common</feature>
>>>>>
>>>>> in the list of boot features.
>>>>>
>>>>> The rosapi-common feature exists in a feature.xml:
>>>>>
>>>>>           <dependency>
>>>>>               <groupId>${project.groupId}</groupId>
>>>>>               <artifactId>rosapi-features</artifactId>
>>>>>               <version>${project.version}</version>
>>>>>               <classifier>features</classifier>
>>>>>               <type>xml</type>
>>>>>               <scope>runtime</scope>
>>>>>           </dependency>
>>>>>
>>>>> Which contains:
>>>>>
>>>>>       <feature name="rosapi-common" description="rosapi-common"
>>>>> version="0.7.105.SNAPSHOT">
>>>>>           <details>Code in common for Rosette API Web Service
>>>>> 1.5</details>
>>>>>           <feature prerequisite="false"
>>>>> dependency="false">bean-validation-support</feature>
>>>>>
>>>>> <bundle>mvn:com.basistech.ws/rosapi-common/0.7.105-SNAPSHOT</bundle>
>>>>>          ...
>>>>>       </feature>
>>>>>
>>>>> Note the - in the version in the error message, but the . in the
>>>>> version in the feature.xml. It's a generated feature.xml via the
>>>>> karaf-maven-plugin. Is there a way to write the version in the pom
>>>>> boot list to get around this?
>>>>>
>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> [email protected]
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>
>>
>> --
>> Jean-Baptiste Onofré
>> [email protected]
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com

Reply via email to