Hi Alex,

Can you try this condition:

<condition>req:osgi.ee;filter:="(&amp;(osgi.ee=JavaSE)(!(version>=1.8)))"</condition>

And also remove the dependency flag.

Regards
JB

> Le 27 févr. 2020 à 15:42, Alex Soto <alex.s...@envieta.com> a écrit :
> 
> Perhaps I am still doing something wrong, or not understanding how the 
> condition works.
> I have this in my features.xml:
> 
> 
>               <conditional>
>                       <!-- From Java 9 and up add JaveEE dependencies -->
>                       
> <condition>req:osgi.ee;filter:="(&amp;(osgi.ee=JavaSE)(version>=9))"</condition>
> 
>                       <bundle 
> dependency="true">mvn:jakarta.xml.bind/jakarta.xml.bind-api/${jaxb.version}</bundle>
>                       <bundle 
> dependency="true">mvn:com.sun.activation/javax.activation/1.2.0</bundle>
>                       <bundle 
> dependency="true">wrap:mvn:org.glassfish.jaxb/txw2/${jaxb.version}</bundle>
>                       <bundle 
> dependency="true">mvn:com.sun.istack/istack-commons-runtime/3.0.8</bundle>
>                       <bundle 
> dependency="true">mvn:org.jvnet.staxex/stax-ex/1.8.1</bundle>
>                       <bundle 
> dependency="true">mvn:com.sun.xml.fastinfoset/FastInfoset/1.2.16</bundle>
>                       <bundle 
> dependency="true">wrap:mvn:org.glassfish.jaxb/jaxb-runtime/${jaxb.version}</bundle>
>               </conditional>
> 
> 
> But when I run on Java 8, the above bundles are deployed, but my intention is 
> the opposite. 
> Of course this causes a lot of errors. Please help.
> 
> Best regards,
> Alex soto
> 
> 
> 
> 
>> On Feb 26, 2020, at 4:21 PM, Jean-Baptiste Onofré <j...@nanthrax.net 
>> <mailto:j...@nanthrax.net>> wrote:
>> 
>> Thanks Guillaume, it?s what I was looking for. 
>> 
>> Regards 
>> JB
>> 
>> Le mer. 26 f?vr. 2020 ? 21:31, Guillaume Nodet <gno...@apache.org 
>> <mailto:gno...@apache.org>> a ?crit :
>> This should be doable using something like in the test 
>> https://github.com/apache/karaf/blob/master/features/core/src/test/resources/org/apache/karaf/features/internal/service/f06.xml#L30-L33
>>  
>> <https://github.com/apache/karaf/blob/master/features/core/src/test/resources/org/apache/karaf/features/internal/service/f06.xml#L30-L33>
>> Le mer. 26 f?vr. 2020 ? 19:53, Alex Soto <alex.s...@envieta.com 
>> <mailto:alex.s...@envieta.com>> a ?crit :
>> In Features XML, is it possible to add a bundle conditionally based on JDK 
>> version?
>> 
>> <conditional>
>>      <condition>???</condition>
>> </conditonal>
>> 
>> BTW, I could not find documentation about what can be put in the condition 
>> tag.
>> I looked here https://karaf.apache.org/manual/latest/provisioning 
>> <https://karaf.apache.org/manual/latest/provisioning> but there is no 
>> mention of this.
>> 
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>> 
>> 
>> 
>> -- 
>> ------------------------
>> Guillaume Nodet
>> 
> 

Reply via email to