You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Christian Schneider (JIRA)" <ji...@apache.org> on 2012/05/31 17:02:24 UTC

[jira] [Created] (KARAF-1514) Improve feature file generation to be able to create features out of special feature poms

Christian Schneider created KARAF-1514:
------------------------------------------

             Summary: Improve feature file generation to be able to create features out of special feature poms
                 Key: KARAF-1514
                 URL: https://issues.apache.org/jira/browse/KARAF-1514
             Project: Karaf
          Issue Type: Improvement
            Reporter: Christian Schneider


Currently we have no way to describe several features without having a template feature file.

To improve that we could describe a single feature as a pom which can depend on other poms and jars. We could then create another pom for the feature file which depends on the feature poms with scope feature. So the plugin would know to create a feature for each pom of scope feature. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KARAF-1514) Improve feature file generation to be able to create features out of special feature poms

Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286675#comment-13286675 ] 

Benjamin Reed commented on KARAF-1514:
--------------------------------------

Here's a simple set of maven projects that lays things out:

https://github.com/RangerRick/karaf-test-cases/tree/4349700d1d8d61a767d96a167da8cab97db36815

Right now, everything looks exactly as expected, except features/02's features.xml is missing the <feature> dependency on feature-01, and it's adding a wrap:mvn for the feature-01 pom.

ie, current output:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="feature-02">
    <feature description="Feature Test Case 01 (3rd-Party Dependencies)" name="feature-01">
        <bundle>mvn:org.apache.commons/commons-exec/1.1</bundle>
    </feature>
    <feature description="Feature Test Case 02 (Bundle + 3rd-Party Dependencies)" name="feature-02">
        <bundle>mvn:com.example.test.bundles/com.example.test.api/1.0-SNAPSHOT</bundle>
        <bundle>mvn:com.example.test.bundles/com.example.test.execthing/1.0-SNAPSHOT</bundle>
        <bundle>wrap:mvn:com.example.test.features/feature-01/1.0-SNAPSHOT/pom</bundle>
    </feature>
</features>


expected output if <scope>feature</scope> worked as a dependency:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="feature-02">
    <feature description="Feature Test Case 01 (3rd-Party Dependencies)" name="feature-01">
        <bundle>mvn:org.apache.commons/commons-exec/1.1</bundle>
    </feature>
    <feature description="Feature Test Case 02 (Bundle + 3rd-Party Dependencies)" name="feature-02">
        <bundle>mvn:com.example.test.bundles/com.example.test.api/1.0-SNAPSHOT</bundle>
        <bundle>mvn:com.example.test.bundles/com.example.test.execthing/1.0-SNAPSHOT</bundle>
        <feature>feature-01</feature>
    </feature>
</features>
                
> Improve feature file generation to be able to create features out of special feature poms
> -----------------------------------------------------------------------------------------
>
>                 Key: KARAF-1514
>                 URL: https://issues.apache.org/jira/browse/KARAF-1514
>             Project: Karaf
>          Issue Type: Improvement
>            Reporter: Christian Schneider
>
> Currently we have no way to describe several features without having a template feature file.
> To improve that we could describe a single feature as a pom which can depend on other poms and jars. We could then create another pom for the feature file which depends on the feature poms with scope feature. So the plugin would know to create a feature for each pom of scope feature. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (KARAF-1514) Improve feature file generation to be able to create features out of special feature poms

Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286675#comment-13286675 ] 

Benjamin Reed edited comment on KARAF-1514 at 5/31/12 3:57 PM:
---------------------------------------------------------------

Here's a simple set of maven projects that lays things out:

https://github.com/RangerRick/karaf-test-cases/tree/4349700d1d8d61a767d96a167da8cab97db36815

Right now, everything looks exactly as expected, except features/02's features.xml is missing the <feature> dependency on feature-01, and it's adding a wrap:mvn for the feature-01 pom.

ie, current output:

{code}<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="feature-02">
    <feature description="Feature Test Case 01 (3rd-Party Dependencies)" name="feature-01">
        <bundle>mvn:org.apache.commons/commons-exec/1.1</bundle>
    </feature>
    <feature description="Feature Test Case 02 (Bundle + 3rd-Party Dependencies)" name="feature-02">
        <bundle>mvn:com.example.test.bundles/com.example.test.api/1.0-SNAPSHOT</bundle>
        <bundle>mvn:com.example.test.bundles/com.example.test.execthing/1.0-SNAPSHOT</bundle>
        <bundle>wrap:mvn:com.example.test.features/feature-01/1.0-SNAPSHOT/pom</bundle>
    </feature>
</features>{code}

expected output if <scope>feature</scope> worked as a dependency:

{code}<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="feature-02">
    <feature description="Feature Test Case 01 (3rd-Party Dependencies)" name="feature-01">
        <bundle>mvn:org.apache.commons/commons-exec/1.1</bundle>
    </feature>
    <feature description="Feature Test Case 02 (Bundle + 3rd-Party Dependencies)" name="feature-02">
        <bundle>mvn:com.example.test.bundles/com.example.test.api/1.0-SNAPSHOT</bundle>
        <bundle>mvn:com.example.test.bundles/com.example.test.execthing/1.0-SNAPSHOT</bundle>
        <feature>feature-01</feature>
    </feature>
</features>{code}
                
      was (Author: rangerrick):
    Here's a simple set of maven projects that lays things out:

https://github.com/RangerRick/karaf-test-cases/tree/4349700d1d8d61a767d96a167da8cab97db36815

Right now, everything looks exactly as expected, except features/02's features.xml is missing the <feature> dependency on feature-01, and it's adding a wrap:mvn for the feature-01 pom.

ie, current output:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="feature-02">
    <feature description="Feature Test Case 01 (3rd-Party Dependencies)" name="feature-01">
        <bundle>mvn:org.apache.commons/commons-exec/1.1</bundle>
    </feature>
    <feature description="Feature Test Case 02 (Bundle + 3rd-Party Dependencies)" name="feature-02">
        <bundle>mvn:com.example.test.bundles/com.example.test.api/1.0-SNAPSHOT</bundle>
        <bundle>mvn:com.example.test.bundles/com.example.test.execthing/1.0-SNAPSHOT</bundle>
        <bundle>wrap:mvn:com.example.test.features/feature-01/1.0-SNAPSHOT/pom</bundle>
    </feature>
</features>


expected output if <scope>feature</scope> worked as a dependency:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="feature-02">
    <feature description="Feature Test Case 01 (3rd-Party Dependencies)" name="feature-01">
        <bundle>mvn:org.apache.commons/commons-exec/1.1</bundle>
    </feature>
    <feature description="Feature Test Case 02 (Bundle + 3rd-Party Dependencies)" name="feature-02">
        <bundle>mvn:com.example.test.bundles/com.example.test.api/1.0-SNAPSHOT</bundle>
        <bundle>mvn:com.example.test.bundles/com.example.test.execthing/1.0-SNAPSHOT</bundle>
        <feature>feature-01</feature>
    </feature>
</features>
                  
> Improve feature file generation to be able to create features out of special feature poms
> -----------------------------------------------------------------------------------------
>
>                 Key: KARAF-1514
>                 URL: https://issues.apache.org/jira/browse/KARAF-1514
>             Project: Karaf
>          Issue Type: Improvement
>            Reporter: Christian Schneider
>
> Currently we have no way to describe several features without having a template feature file.
> To improve that we could describe a single feature as a pom which can depend on other poms and jars. We could then create another pom for the feature file which depends on the feature poms with scope feature. So the plugin would know to create a feature for each pom of scope feature. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KARAF-1514) Improve feature file generation to be able to create features out of special feature poms

Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286813#comment-13286813 ] 

Benjamin Reed commented on KARAF-1514:
--------------------------------------

OK, there's one other thing that's an issue that I talked about in IRC a bit before we started our latest conversation; I've updated the test-cases to reflect it:

https://github.com/RangerRick/karaf-test-cases/tree/67d6856af095a990d7bce480f4b4de5d2117f2de

The problem is with things that are to be provided by the container, for example, servlet-api.  In the "features/01" project, I've updated it so that it uses a template features.xml which depends on karaf's built-in "http" feature, and the resultant features.xml generates like so:

{code}<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="feature-01">
    <feature description="Feature Test Case 01 (3rd-Party Dependencies)" version="1.0-SNAPSHOT" name="feature-01">
        <feature version="[2.2.7,3)">http</feature>
        <bundle>mvn:org.apache.commons/commons-exec/1.1</bundle>
        <bundle>wrap:mvn:javax.servlet/servlet-api/2.5</bundle>
    </feature>
</features>{code}

The problem is that the karaf "http" feature already provides the equivalent servlet-api, so it shouldn't be included here.  I've set the servlet-api dependency as scope "provided" in the pom (which should mean in maven-speak, "use this to compile, but do not treat it as a dependency, I will make sure the container provides this") but it's still being included in the generated features.xml.
                
> Improve feature file generation to be able to create features out of special feature poms
> -----------------------------------------------------------------------------------------
>
>                 Key: KARAF-1514
>                 URL: https://issues.apache.org/jira/browse/KARAF-1514
>             Project: Karaf
>          Issue Type: Improvement
>            Reporter: Christian Schneider
>
> Currently we have no way to describe several features without having a template feature file.
> To improve that we could describe a single feature as a pom which can depend on other poms and jars. We could then create another pom for the feature file which depends on the feature poms with scope feature. So the plugin would know to create a feature for each pom of scope feature. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KARAF-1514) Improve feature file generation to be able to create features out of special feature poms

Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Reed updated KARAF-1514:
---------------------------------

    Attachment: 0001-allow-ignoring-scope-provided-dependencies.patch

Here's a simple patch that implements that. It adds a configuration option "ignoreScopeProvided" which defaults to false.  If set true, it will skip <scope>provided</scope> dependencies when generating features.xml.

I would argue it should default to true (for reasons above) but I didn't want to break any existing behavior people might be relying upon.
                
> Improve feature file generation to be able to create features out of special feature poms
> -----------------------------------------------------------------------------------------
>
>                 Key: KARAF-1514
>                 URL: https://issues.apache.org/jira/browse/KARAF-1514
>             Project: Karaf
>          Issue Type: Improvement
>            Reporter: Christian Schneider
>         Attachments: 0001-allow-ignoring-scope-provided-dependencies.patch
>
>
> Currently we have no way to describe several features without having a template feature file.
> To improve that we could describe a single feature as a pom which can depend on other poms and jars. We could then create another pom for the feature file which depends on the feature poms with scope feature. So the plugin would know to create a feature for each pom of scope feature. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KARAF-1514) Improve feature file generation to be able to create features out of special feature poms

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286708#comment-13286708 ] 

Christian Schneider commented on KARAF-1514:
--------------------------------------------

Yes that should do it. Now the only thing is how to handle features that should not be defined in the current feature file but should be only referenced. This might already work though by using dependencies on external feature files in the feature file pom.
                
> Improve feature file generation to be able to create features out of special feature poms
> -----------------------------------------------------------------------------------------
>
>                 Key: KARAF-1514
>                 URL: https://issues.apache.org/jira/browse/KARAF-1514
>             Project: Karaf
>          Issue Type: Improvement
>            Reporter: Christian Schneider
>
> Currently we have no way to describe several features without having a template feature file.
> To improve that we could describe a single feature as a pom which can depend on other poms and jars. We could then create another pom for the feature file which depends on the feature poms with scope feature. So the plugin would know to create a feature for each pom of scope feature. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira