You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by wuaner <wu...@gmail.com> on 2016/07/01 06:23:53 UTC

Re: karaf-maven-plugin features-generate-descriptor

My concerns also.

When using maven with karaf, what's the BEST PRACTICES of feature.xml?

Create a standalone project per feature(and packaging of pom.xml setting to
feature), or just add karaf-maven-plugin to pom.xml of original project, and
binding features-generate-descriptor to prject's build lifecycle?

Can anyone here help us, pls?

Thanks.!



--
View this message in context: http://karaf.922171.n3.nabble.com/karaf-maven-plugin-features-generate-descriptor-tp4029160p4047036.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: karaf-maven-plugin features-generate-descriptor

Posted by Sigmund Lee <wu...@gmail.com>.
Hi Achim,

Thanks for clearing things up, that was very thoughtful.

Best Regards.
--
Sig

On Fri, Jul 1, 2016 at 3:33 PM, Sigmund Lee <wu...@gmail.com> wrote:

> A example:
>
> demo-service  dependent on:
>> a.jar
>> b.jar
>>
>> demo-webapp  dependent on:
>> c.jar
>> d.jar
>> demo-rest  dependent on:
>> d.jar
>> e.jar
>
>
>
> How can I get a feature repo like this(using maven dependencies):
>
> <features name="demo-features">
>> <feature name="demo-service-feature">
>> <bundle a.jar/>
>> <bundle b.jar/>
>> </feature>
>> <feature name="demo-webapp-feature">
>> <feature demo-service-feature/>
>> <bundle c.jar/>
>> <bundle d.jar/>
>> </feature>
>> <feature name="demo-rest-feature">
>> <feature demo-service-feature/>
>> <bundle d.jar/>
>> <bundle e.jar/>
>> </feature>
>> </features>
>
>
>
> Bests.
>
> --
> Sig
>
>
> On Fri, Jul 1, 2016 at 3:20 PM, Sigmund Lee <wu...@gmail.com> wrote:
>
>> Hi achim,
>>
>> One and only one extra maven module(packaging:feature) for all features
>> of this project? I got it! thanks!
>>
>> Then, How you deal with maven dependencies? I mean, generate feature with
>> bundles that project dependent on,, that's what I want and why using
>> karaf-maven-plugin.
>>
>> How can I handle different dependencies for different sub-module when
>> using one extra maven module for all features, since
>> features-generate-descriptor will add all dependencies of this extra maven
>> module to primary feature(feature that same name as the artifactId of the
>> project)?
>>
>>
>> Sorry for my poor english, hope you get my point, thanks again!
>>
>> Bests.
>>
>>
>> On Fri, Jul 1, 2016 at 2:53 PM, Achim Nierbeck <bc...@googlemail.com>
>> wrote:
>>
>>> Hi Sig,
>>>
>>> I usually have one extra sub-module for my features.
>>> This usually contains of one feature file with multiple features. [1]
>>>
>>> regards, Achim
>>>
>>> [1] -
>>> https://github.com/ANierbeck/Karaf-Cassandra/tree/master/Karaf-Cassandra-Feature
>>>
>>> 2016-07-01 8:51 GMT+02:00 Sigmund Lee <wu...@gmail.com>:
>>>
>>>> Hi Achim,
>>>>
>>>> Thank you so much for prompt response.
>>>>
>>>> A maven project may have several sub-projects, some of them may need a
>>>> karaf feature.
>>>>
>>>> When you said "extra project for features", does that means:
>>>>
>>>> *1. one and only one* extra project(feature as packaging of pom.xml)
>>>> for all features of this project,
>>>>
>>>> or
>>>>
>>>> *2.* extra project for *every* feature, something like this(assuming
>>>> project name is demo. demo-service, demo-rest, demo-webapp, demo-client,
>>>> etc.):
>>>>
>>>>> demo-features(pockaging:pom)
>>>>>   demo-service-feature(packaging:feature)
>>>>>   demo-rest-feature(packaging:feature)
>>>>>   demo-webapp-feature(packaging:feature)
>>>>>   demo-client-feature(packaging:feature)
>>>>
>>>>
>>>>
>>>> Best wishes.
>>>> --
>>>> Sig
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> 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
>>>
>>>
>>
>

Re: karaf-maven-plugin features-generate-descriptor

Posted by Sigmund Lee <wu...@gmail.com>.
A example:

demo-service  dependent on:
> a.jar
> b.jar
>
> demo-webapp  dependent on:
> c.jar
> d.jar
> demo-rest  dependent on:
> d.jar
> e.jar



How can I get a feature repo like this(using maven dependencies):

<features name="demo-features">
> <feature name="demo-service-feature">
> <bundle a.jar/>
> <bundle b.jar/>
> </feature>
> <feature name="demo-webapp-feature">
> <feature demo-service-feature/>
> <bundle c.jar/>
> <bundle d.jar/>
> </feature>
> <feature name="demo-rest-feature">
> <feature demo-service-feature/>
> <bundle d.jar/>
> <bundle e.jar/>
> </feature>
> </features>



Bests.

--
Sig


On Fri, Jul 1, 2016 at 3:20 PM, Sigmund Lee <wu...@gmail.com> wrote:

> Hi achim,
>
> One and only one extra maven module(packaging:feature) for all features of
> this project? I got it! thanks!
>
> Then, How you deal with maven dependencies? I mean, generate feature with
> bundles that project dependent on,, that's what I want and why using
> karaf-maven-plugin.
>
> How can I handle different dependencies for different sub-module when
> using one extra maven module for all features, since
> features-generate-descriptor will add all dependencies of this extra maven
> module to primary feature(feature that same name as the artifactId of the
> project)?
>
>
> Sorry for my poor english, hope you get my point, thanks again!
>
> Bests.
>
>
> On Fri, Jul 1, 2016 at 2:53 PM, Achim Nierbeck <bc...@googlemail.com>
> wrote:
>
>> Hi Sig,
>>
>> I usually have one extra sub-module for my features.
>> This usually contains of one feature file with multiple features. [1]
>>
>> regards, Achim
>>
>> [1] -
>> https://github.com/ANierbeck/Karaf-Cassandra/tree/master/Karaf-Cassandra-Feature
>>
>> 2016-07-01 8:51 GMT+02:00 Sigmund Lee <wu...@gmail.com>:
>>
>>> Hi Achim,
>>>
>>> Thank you so much for prompt response.
>>>
>>> A maven project may have several sub-projects, some of them may need a
>>> karaf feature.
>>>
>>> When you said "extra project for features", does that means:
>>>
>>> *1. one and only one* extra project(feature as packaging of pom.xml)
>>> for all features of this project,
>>>
>>> or
>>>
>>> *2.* extra project for *every* feature, something like this(assuming
>>> project name is demo. demo-service, demo-rest, demo-webapp, demo-client,
>>> etc.):
>>>
>>>> demo-features(pockaging:pom)
>>>>   demo-service-feature(packaging:feature)
>>>>   demo-rest-feature(packaging:feature)
>>>>   demo-webapp-feature(packaging:feature)
>>>>   demo-client-feature(packaging:feature)
>>>
>>>
>>>
>>> Best wishes.
>>> --
>>> Sig
>>>
>>
>>
>>
>> --
>>
>> 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
>>
>>
>

Re: karaf-maven-plugin features-generate-descriptor

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Sig,

when building new features I usually start of with generation, after a
certain point in time, I take those generated features and trim them to the
point where I am in charge of defining the features. In the end it's easier
to define feature files yourself for bigger feature file, and only use the
karaf-maven-plugin for feature verification.
For example take a look at the features definition of the Pax-Web
Project[1], you'll see a lot of different feature definitions with
different dependencies within the same feature file. At this point the
karaf-maven-plugin isn't capable of managing such a "complex" dependency
structure, but does a great point in verifying that it's actually
resolvable during runtime.

regards, Achim
[1] -
https://github.com/ops4j/org.ops4j.pax.web/blob/master/pax-web-features/src/main/resources/features.xml


2016-07-01 9:20 GMT+02:00 Sigmund Lee <wu...@gmail.com>:

> Hi achim,
>
> One and only one extra maven module(packaging:feature) for all features of
> this project? I got it! thanks!
>
> Then, How you deal with maven dependencies? I mean, generate feature with
> bundles that project dependent on,, that's what I want and why using
> karaf-maven-plugin.
>
> How can I handle different dependencies for different sub-module when
> using one extra maven module for all features, since
> features-generate-descriptor will add all dependencies of this extra maven
> module to primary feature(feature that same name as the artifactId of the
> project)?
>
>
> Sorry for my poor english, hope you get my point, thanks again!
>
> Bests.
>
>
> On Fri, Jul 1, 2016 at 2:53 PM, Achim Nierbeck <bc...@googlemail.com>
> wrote:
>
>> Hi Sig,
>>
>> I usually have one extra sub-module for my features.
>> This usually contains of one feature file with multiple features. [1]
>>
>> regards, Achim
>>
>> [1] -
>> https://github.com/ANierbeck/Karaf-Cassandra/tree/master/Karaf-Cassandra-Feature
>>
>> 2016-07-01 8:51 GMT+02:00 Sigmund Lee <wu...@gmail.com>:
>>
>>> Hi Achim,
>>>
>>> Thank you so much for prompt response.
>>>
>>> A maven project may have several sub-projects, some of them may need a
>>> karaf feature.
>>>
>>> When you said "extra project for features", does that means:
>>>
>>> *1. one and only one* extra project(feature as packaging of pom.xml)
>>> for all features of this project,
>>>
>>> or
>>>
>>> *2.* extra project for *every* feature, something like this(assuming
>>> project name is demo. demo-service, demo-rest, demo-webapp, demo-client,
>>> etc.):
>>>
>>>> demo-features(pockaging:pom)
>>>>   demo-service-feature(packaging:feature)
>>>>   demo-rest-feature(packaging:feature)
>>>>   demo-webapp-feature(packaging:feature)
>>>>   demo-client-feature(packaging:feature)
>>>
>>>
>>>
>>> Best wishes.
>>> --
>>> Sig
>>>
>>
>>
>>
>> --
>>
>> 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
>>
>>
>


-- 

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

Re: karaf-maven-plugin features-generate-descriptor

Posted by Sigmund Lee <wu...@gmail.com>.
Hi achim,

One and only one extra maven module(packaging:feature) for all features of
this project? I got it! thanks!

Then, How you deal with maven dependencies? I mean, generate feature with
bundles that project dependent on,, that's what I want and why using
karaf-maven-plugin.

How can I handle different dependencies for different sub-module when using
one extra maven module for all features, since features-generate-descriptor
will add all dependencies of this extra maven module to primary
feature(feature that same name as the artifactId of the project)?


Sorry for my poor english, hope you get my point, thanks again!

Bests.


On Fri, Jul 1, 2016 at 2:53 PM, Achim Nierbeck <bc...@googlemail.com>
wrote:

> Hi Sig,
>
> I usually have one extra sub-module for my features.
> This usually contains of one feature file with multiple features. [1]
>
> regards, Achim
>
> [1] -
> https://github.com/ANierbeck/Karaf-Cassandra/tree/master/Karaf-Cassandra-Feature
>
> 2016-07-01 8:51 GMT+02:00 Sigmund Lee <wu...@gmail.com>:
>
>> Hi Achim,
>>
>> Thank you so much for prompt response.
>>
>> A maven project may have several sub-projects, some of them may need a
>> karaf feature.
>>
>> When you said "extra project for features", does that means:
>>
>> *1. one and only one* extra project(feature as packaging of pom.xml) for
>> all features of this project,
>>
>> or
>>
>> *2.* extra project for *every* feature, something like this(assuming
>> project name is demo. demo-service, demo-rest, demo-webapp, demo-client,
>> etc.):
>>
>>> demo-features(pockaging:pom)
>>>   demo-service-feature(packaging:feature)
>>>   demo-rest-feature(packaging:feature)
>>>   demo-webapp-feature(packaging:feature)
>>>   demo-client-feature(packaging:feature)
>>
>>
>>
>> Best wishes.
>> --
>> Sig
>>
>
>
>
> --
>
> 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
>
>

Re: karaf-maven-plugin features-generate-descriptor

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Sig,

I usually have one extra sub-module for my features.
This usually contains of one feature file with multiple features. [1]

regards, Achim

[1] -
https://github.com/ANierbeck/Karaf-Cassandra/tree/master/Karaf-Cassandra-Feature

2016-07-01 8:51 GMT+02:00 Sigmund Lee <wu...@gmail.com>:

> Hi Achim,
>
> Thank you so much for prompt response.
>
> A maven project may have several sub-projects, some of them may need a
> karaf feature.
>
> When you said "extra project for features", does that means:
>
> *1. one and only one* extra project(feature as packaging of pom.xml) for
> all features of this project,
>
> or
>
> *2.* extra project for *every* feature, something like this(assuming
> project name is demo. demo-service, demo-rest, demo-webapp, demo-client,
> etc.):
>
>> demo-features(pockaging:pom)
>>   demo-service-feature(packaging:feature)
>>   demo-rest-feature(packaging:feature)
>>   demo-webapp-feature(packaging:feature)
>>   demo-client-feature(packaging:feature)
>
>
>
> Best wishes.
> --
> Sig
>



-- 

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

Re: karaf-maven-plugin features-generate-descriptor

Posted by Sigmund Lee <wu...@gmail.com>.
Hi Achim,

Thank you so much for prompt response.

A maven project may have several sub-projects, some of them may need a
karaf feature.

When you said "extra project for features", does that means:

*1. one and only one* extra project(feature as packaging of pom.xml) for
all features of this project,

or

*2.* extra project for *every* feature, something like this(assuming
project name is demo. demo-service, demo-rest, demo-webapp, demo-client,
etc.):

> demo-features(pockaging:pom)
>   demo-service-feature(packaging:feature)
>   demo-rest-feature(packaging:feature)
>   demo-webapp-feature(packaging:feature)
>   demo-client-feature(packaging:feature)



Best wishes.
--
Sig

Re: karaf-maven-plugin features-generate-descriptor

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

regarding best practice, I'd suggest to have an extra project for features.

regards, Achim


2016-07-01 8:23 GMT+02:00 wuaner <wu...@gmail.com>:

> My concerns also.
>
> When using maven with karaf, what's the BEST PRACTICES of feature.xml?
>
> Create a standalone project per feature(and packaging of pom.xml setting to
> feature), or just add karaf-maven-plugin to pom.xml of original project,
> and
> binding features-generate-descriptor to prject's build lifecycle?
>
> Can anyone here help us, pls?
>
> Thanks.!
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/karaf-maven-plugin-features-generate-descriptor-tp4029160p4047036.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 

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