[ 
https://issues.apache.org/jira/browse/KARAF-5199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16067164#comment-16067164
 ] 

Andrei Shakirin edited comment on KARAF-5199 at 6/28/17 8:22 PM:
-----------------------------------------------------------------

Hi Guillaume,

Thanks for looking into the issue.
Explicit bundle versioning works as well as explicit jollyday feature 
versioning:
{code}
    <feature name="basit-test-feature" version="${pom.version}">
        <feature 
version="${jollyday.version}">basit-thirdparty-jollyday</feature>
        <bundle>mvn:${project.groupId}/test-jolly/${project.version}</bundle>
    </feature>
{code}

Anyway it looks as workaround for me.
I agree that the wrapped bundle version is not recognizable, but the bunde 
belongs to the feature, that has concrete version.
Following questions:
1) Why the version resolution works correctly (even with wrapped bundle without 
version) if I try install basit-thirdparty-jollyday feature directly? In this 
case correct version of jollyday bundle will be installed
2) Why the version resolution works correctly (even with wrapped bundle without 
version) if I remove test-jolly bundle from basit-test-feature and install 
basit-test-feature?

The behavior ( that both versions or only single version of jollyday will be 
installed) depends on existence of bundle importing some jollyday packages in 
the feature. To be honest, this behavior looks a bit non-determenistic for me.
What do you think?


was (Author: ashakirin):
Hi Guillaume,

Thanks for looking into the issue.
Explicit bundle versioning works as well as explicit jollyday feature 
versioning:
{code}
    <feature name="basit-test-feature" version="${pom.version}">
        <feature 
version="${jollyday.version}">basit-thirdparty-jollyday</feature>
        <bundle>mvn:${project.groupId}/test-jolly/${project.version}</bundle>
    </feature>
{code}

Anyway it looks as workaround for me.
I agree that the wrapped bundle version is not recognizable, but the bunde 
belongs to the feature, that has concrete version.
Following questions:
1) Why the version resolution works correctly (even with wrapped bundle without 
version) if I try install basit-thirdparty-jollyday feature directly? In this 
case correct version of jollyday bundle will be installed
2) Why the version resolution works correctly (even with wrapped bundle without 
version) if I remove test-jolly bundle from basit-test-feature and install 
basit-test-feature?

The behavior ( that both versions or only single version of jollyday will be 
installed) depends on existence of bundle importing some jollyday packages in 
the feature. To be honest, this behavior looks a bit non-determenistic for me.
What do you think?
But as soon as feature contains

> Karaf installs both version of the feature (old and new) in case if 
> referencing feature contains wrapped bundle with package import
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: KARAF-5199
>                 URL: https://issues.apache.org/jira/browse/KARAF-5199
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-feature
>    Affects Versions: 4.0.9
>            Reporter: Andrei Shakirin
>            Assignee: Guillaume Nodet
>         Attachments: org.apache.karaf.features.cfg, test-feature-project.zip
>
>
> Accordingly documentation, if feature is available in multiple versions, the 
> newest version have to be installed:
> {code}
> The <feature/> element contains the name of a feature. A specific feature 
> version can be defined using the version attribute to the <feature/> element 
> (<feature version="1.0.0">feature1</feature>). If the version attribute is 
> not specified, Apache Karaf will install the latest version available.
> {code}
> Unfortunatelly it is not always the case.
> Use case:
> 1) feature basit-thirdparty-jollyday references wrapped jar (jollyday 
> library); this feature is available in two different versions (1.0.0-SNAPSHOT 
> and 2.0.0-SNAPSHOT) and contains different versions of jolly (0.4.6 and 0.5.2 
> correspondingly);
> 2) bundle test-jolly uses packages from wrapped jar (jollyday library);
> 3) feature test-feature references basit-thirdparty-jollyday and test-jolly 
> bundle.
> Karaf repositories list contains both versions of basit-thirdparty-jollyday 
> and  test-feature:
> {code}
> karaf@root()> feature:list | grep basit
> basit-thirdparty-jollyday     | 2.0.0.SNAPSHOT   |          | Uninstalled | 
> ccp
>                      |
> basit-thirdparty-jollyday     | 1.0.0.SNAPSHOT   |          | Uninstalled | 
> ccp
>                      |
> basit-test-feature            | 1.0.0.SNAPSHOT   |          | Uninstalled | 
> ccp
>                      |
> karaf@root()>{code}
> If I try to install basit-thirdparty-jollyday feature - it works as expected: 
> only 2.0.0.SNAPSHOT will be installed:
> {code}
> karaf@root()> feature:install -t -v basit-thirdparty-jollyday
> Adding features: basit-thirdparty-jollyday/[2.0.0.SNAPSHOT,2.0.0.SNAPSHOT]
> Changes to perform:
>   Region: root
>     Bundles to install:
>       wrap:mvn:de.jollyday/jollyday/0.5.2
> {code}
> But if I try to install basit-test-feature, Karaf installs BOTH versions of 
> basit-thirdparty-jollyday:
> {code}
> karaf@root()> feature:install -t -v basit-test-feature
> Adding features: basit-test-feature/[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]
> Changes to perform:
>   Region: root
>     Bundles to install:
>       mvn:de.conrad.ccp.basit/test-jolly/1.0.0-SNAPSHOT
>       wrap:mvn:de.jollyday/jollyday/0.4.6
>       wrap:mvn:de.jollyday/jollyday/0.5.2
> karaf@root()>
> {code}
> If I exclude bundle test-jolly from basit-test-feature, installation works as 
> expected again (only new jolly feature will be installed)
> The test projects to reproduce the problem and org.apache.karaf.features.cfg 
> are attached



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to