[
https://issues.apache.org/jira/browse/KARAF-2820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Igor Lazebny updated KARAF-2820:
--------------------------------
Attachment: pom.xml
Retested with latest snapshot. Situation is really improved. I got all latest
versions of features. But some of features are included twice, with different
versions. Please try pom.xml attached.
Next features are included twice (2.7.10 and 2.7.7): cxf-core, cxf-http,
cxf-specs. Plugin config is pretty simple, just 2 features configured (cxf and
camel), they are not related. I can't find a reason why 2.7.7 could be required.
In case if I change CXF version from 2.7.10 to 2.7.9 - no feature version
duplication, just only latest one.
So, it really looks like comparing version as String is the root reason.
> features-maven-plugin:add-features-to-repo adds wrong transitive feature
> version
> --------------------------------------------------------------------------------
>
> Key: KARAF-2820
> URL: https://issues.apache.org/jira/browse/KARAF-2820
> Project: Karaf
> Issue Type: Bug
> Components: karaf-tooling
> Affects Versions: 2.3.4
> Reporter: Igor Lazebny
> Assignee: Freeman Fang
> Attachments: pom.xml
>
>
> features-maven-plugin:add-features-to-repo tries to find greatest version of
> transitive feature to add. But the problem is it compares versions as string.
> So, for example, "2.7.7" > "2.7.10".
> Here is that part in
> tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/AddFeaturesToRepoMojo.java
> 313 // looking for the feature name (with the greatest
> version)
> 314 for (String key : featuresMap.keySet()) {
> 315 String[] nameVersion = key.split("/");
> 316 if (feature.equals(nameVersion[0])) {
> 317 if (f == null ||
> f.getVersion().compareTo(featuresMap.get(key).getVersion()) < 0) {
> 318 f = featuresMap.get(key);
> 319 }
> 320 }
> 321 }
> I have an example, which adds 2 features: cxf (2.7.10) and camel (2.12.2).
> Expected result: 2.7.10 CXF bundles in target/features-repo. Actual result:
> 2.7.7 CXF bundles - as transitive through Camel features descriptor.
--
This message was sent by Atlassian JIRA
(v6.2#6252)