Hello

Karaf treats "<feature>my-feature-2</feature>" in karaf-maven-plugin
configuration as (see
org.apache.karaf.profile.assembly.FeatureSelector#getMatchingFeatures())

<feature>my-feature-2/0.0.0</feature>

which is effectively (using range notation): "feature-2/[0, ∞)"

So you should try:

<feature>my-feature-2/[2,3)</feature>
<feature>my-feature-3/3</feature>

Feature ranges and patterns were introduced with
https://issues.apache.org/jira/browse/KARAF-5376

regards
Grzegorz Grzybek

pon., 17 gru 2018 o 11:00 'Achim Nierbeck' via OPS4J <[email protected]>
napisał(a):

> I guess this  would have suited the Karaf mailinglist better.
> Never the less I think I understand your issue.
> As you're installing the "same" feature with just different version, the
> feature resolver (actually the same as for the bundle resolver) doesn't
> seem to understand the need for the same dependencies twice, and therefore
> automatically only installs the latest version.
>
> regards, Achim
>
> Am Mo., 17. Dez. 2018 um 10:55 Uhr schrieb Lukasz Lech <[email protected]
> >:
>
>> Hello,
>>
>>
>>
>> Some time ago I’ve started a thread about building Karaf distribution
>> with maven plugin, and with your help, I’ve got a working example.
>>
>>
>>
>> However, now it’s time to add another version of some feature to the
>> distribution (groupId and artifactId are the same, only the version differ,
>> this is exactly why I need OSGi container instead of, say, Jetty).
>>
>>
>>
>> I have the dependencies in my pom.xml:
>>
>>
>>
>>                                <dependency>
>>
>>                                  <groupId>com.example</groupId>
>>
>>                                  <artifactId>some-features</artifactId>
>>
>>                                  <version>2.5.0-SNAPSHOT</version>
>>
>>                                  <classifier>features</classifier>
>>
>>                                  <type>xml</type>
>>
>>                                  <scope>runtime</scope>
>>
>>                                </dependency>
>>
>>                                <dependency>
>>
>>                                  <groupId>com.example</groupId>
>>
>>                                  <artifactId>some-features</artifactId>
>>
>>                                  <version>3.0.0-SNAPSHOT</version>
>>
>>                                  <classifier>features</classifier>
>>
>>                                  <type>xml</type>
>>
>>                                  <scope>runtime</scope>
>>
>>                                </dependency>
>>
>>
>>
>> And boot features definition:
>>
>>
>>
>>           <bootFeatures>
>>
>>                                  ...
>>
>>
>> <feature>my-feature-2</feature>
>>
>>
>> <feature>my-feature-3</feature>
>>
>>           </bootFeatures>
>>
>>
>>
>> However, I see, that only the newest version (3) is installed. I see no
>> error in logs.
>>
>>
>>
>> The whole setup works perfectly in stand-alone karaf, where the
>> org.apache.karaf.features.cfg is manually edited. But when building using
>> karaf plugin, it looks like the other feature is totally ignored.
>>
>>
>>
>> It has likely to do with inability of Maven to deal with more than 1
>> version of one dependency in single project? If so, how to work around it?
>> Is there any other way to ‘tell’ karaf plugin about required dependencies
>> than pom.xml?
>>
>>
>>
>> Best regards,
>>
>> Lukasz Lech
>>
>>
>>
>>
>>
>> --
>> --
>> ------------------
>> OPS4J - http://www.ops4j.org - [email protected]
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "OPS4J" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
> --
> --
> ------------------
> OPS4J - http://www.ops4j.org - [email protected]
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OPS4J" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to