You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Reto Bachmann-Gmür <re...@apache.org> on 2013/09/08 22:15:25 UTC

karaf-maven-plugin and dependent features

Hello,

I'm doing my first steps with the karaf-maven-plugin.

I created a simple bundle list with projectA and now would like project-B
to depend on project-A resulting in a dependent feature to be added in the
features.xml generated in projectB. Rather than a dependent feature I get
an entry like

<bundle
start-level="50">wrap:mvn:my.company/projectA/1.0-SNAPSHOT/pom</bundle>

Is it possible to include and reference dependent features in the pom using
their maven identification?

Cheers,
Reto

Re: karaf-maven-plugin and dependent features

Posted by rsteppac <ra...@vivates.ch>.
Hi Jean-Baptiste,

yes, I (and Reto) know we can use feature.xml templates. But that is not
what you want in a "POM first" project. The POM is supposed to be the single
source for dependency information, artifact declarations, etc.. Feature
dependencies are just another flavor of dependency, and it would be very
nice if the plugin could resolve them for the feature.xml artifact. 
Otherwise there is duplication of project meta data, is there not? A
dependency feature is normally also a compile time dependency. At least in
my case it is. So the same dependency would have to be maintained in the POM
and the feature.xml template.

As a side question: Do you happen to know if the Camel feature.xml is
maintained manually as well? I noticed that it is incredibly "lean" and does
not state a lot of its actual dependencies. My assumption is that the
knowledge of what bundles are installed in a stock Karaf installation is
worked into that feature file.
If my assumption is correct, is there a way to pull that knowledge into a
Maven project by means of a meta-dependency? So with tool support one could
easily find out what dependencies one carries unnecessarily/are provided if
the runtime-container is Karaf?
If the assumption is wrong, how does it work?


Regards,
Ralf



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

Re: karaf-maven-plugin and dependent features

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi guys,

You can use your own features XML template.

It's what we do in Karaf: basically, when the features XML is a bit 
complex, you can create it by hand.

Regards
JB

On 10/09/2014 02:05 PM, rsteppac wrote:
> Reto,
>
> have you managed to generate the feature dependency information? I am
> struggling with the exact same thing...
>
> My understanding of the  plugin ducumentation
> <http://karaf.apache.org/manual/latest/developers-guide/karaf-maven-plugin-features-generate-descriptor.html>
> is that by setting the property "aggregateFeatures" to false, this should
> happen. But no luck here.
>
>
> Thanks!
> Ralf
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/karaf-maven-plugin-and-dependent-features-tp4029629p4035754.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: karaf-maven-plugin and dependent features

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Reto,

can you provide to me an exact description of your expectations ?

I need a kind of specification to evaluate your requirements and 
implement it.

For instance, a pom and an expected resulting features.xml would help.

Thanks,
Regards
JB

On 10/11/2014 07:29 PM, Reto Gmür wrote:
> Hi Ralf
>
> Unfortunately I didn't get it to work as desired. Do you feel like
> opening an issue in JIRA requesting for this feature?
>
> Cheers,
> Reto
>
> On Thu, Oct 9, 2014 at 2:05 PM, rsteppac <ralf.steppacher@vivates.ch
> <ma...@vivates.ch>> wrote:
>
>     Reto,
>
>     have you managed to generate the feature dependency information? I am
>     struggling with the exact same thing...
>
>     My understanding of the  plugin ducumentation
>     <http://karaf.apache.org/manual/latest/developers-guide/karaf-maven-plugin-features-generate-descriptor.html>
>     is that by setting the property "aggregateFeatures" to false, this
>     should
>     happen. But no luck here.
>
>
>     Thanks!
>     Ralf
>
>
>
>     --
>     View this message in context:
>     http://karaf.922171.n3.nabble.com/karaf-maven-plugin-and-dependent-features-tp4029629p4035754.html
>     Sent from the Karaf - User mailing list archive at Nabble.com.
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: karaf-maven-plugin and dependent features

Posted by Reto Gmür <re...@apache.org>.
Hi Ralf

Unfortunately I didn't get it to work as desired. Do you feel like opening
an issue in JIRA requesting for this feature?

Cheers,
Reto

On Thu, Oct 9, 2014 at 2:05 PM, rsteppac <ra...@vivates.ch> wrote:

> Reto,
>
> have you managed to generate the feature dependency information? I am
> struggling with the exact same thing...
>
> My understanding of the  plugin ducumentation
> <
> http://karaf.apache.org/manual/latest/developers-guide/karaf-maven-plugin-features-generate-descriptor.html
> >
> is that by setting the property "aggregateFeatures" to false, this should
> happen. But no luck here.
>
>
> Thanks!
> Ralf
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/karaf-maven-plugin-and-dependent-features-tp4029629p4035754.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Re: karaf-maven-plugin and dependent features

Posted by rsteppac <ra...@vivates.ch>.
Reto,

have you managed to generate the feature dependency information? I am
struggling with the exact same thing...

My understanding of the  plugin ducumentation
<http://karaf.apache.org/manual/latest/developers-guide/karaf-maven-plugin-features-generate-descriptor.html>  
is that by setting the property "aggregateFeatures" to false, this should
happen. But no luck here.


Thanks!
Ralf



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

Re: karaf-maven-plugin and dependent features

Posted by Reto Bachmann-Gmür <re...@apache.org>.
Hi Jean-Baptiste

Yes that's exactly what I would like to have generated. I see I could add
this manually to the features.xml template but I would prefer to use the
dependency visible also to maven and use the maven tools to add and
maintain the dependency on (the maven artifact generating) "other". Is this
possible?

Cheers,
Reto


On Sun, Sep 8, 2013 at 10:43 PM, Jean-Baptiste Onofré <jb...@nanthrax.net>wrote:

> Hi,
>
> use <feature/> inside the feature:
>
> <feature name="my" version="1.0">
>   <feature>other</feature>
> </feature>
>
> You can also "share" bundle adding dependency="true".
>
> Regards
> JB
>
>
> On 09/08/2013 10:15 PM, Reto Bachmann-Gmür wrote:
>
>> Hello,
>>
>> I'm doing my first steps with the karaf-maven-plugin.
>>
>> I created a simple bundle list with projectA and now would like
>> project-B to depend on project-A resulting in a dependent feature to be
>> added in the features.xml generated in projectB. Rather than a dependent
>> feature I get an entry like
>>
>> <bundle
>> start-level="50">wrap:mvn:my.**company/projectA/1.0-SNAPSHOT/**
>> pom</bundle>
>>
>> Is it possible to include and reference dependent features in the pom
>> using their maven identification?
>>
>> Cheers,
>> Reto
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: karaf-maven-plugin and dependent features

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

use <feature/> inside the feature:

<feature name="my" version="1.0">
   <feature>other</feature>
</feature>

You can also "share" bundle adding dependency="true".

Regards
JB

On 09/08/2013 10:15 PM, Reto Bachmann-Gmür wrote:
> Hello,
>
> I'm doing my first steps with the karaf-maven-plugin.
>
> I created a simple bundle list with projectA and now would like
> project-B to depend on project-A resulting in a dependent feature to be
> added in the features.xml generated in projectB. Rather than a dependent
> feature I get an entry like
>
> <bundle
> start-level="50">wrap:mvn:my.company/projectA/1.0-SNAPSHOT/pom</bundle>
>
> Is it possible to include and reference dependent features in the pom
> using their maven identification?
>
> Cheers,
> Reto
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com