You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by "peter.gardfjall.work" <pe...@gmail.com> on 2012/08/21 10:41:55 UTC

karaf-maven-plugin started producing features with a new namespace (incompatible with Karaf 2.2.9)

Hi all,

I'm using the karaf-maven-plugin 
(org.apache.karaf.tooling:karaf-maven-plugin:3.0.0-SNAPSHOT) to generate 
feature descriptors and kar files.
Note that although I am _running_ these features on a 2.2.9 version of 
Karaf, I'm using the 3.0.0-SNAPSHOT to _generate_ the features, the main 
reason being that the plugin on the 3.0.0 branch has some nice features 
(such as being able to exclude transitive dependencies -- the 
includeTransitiveDependency flag).

If I am correct, a recent commit on the 3.0.0 branch has resulted in the 
karaf-maven-plugin now producing feature descriptors with a new 
namespace ( http://karaf.apache.org/xmlns/features/v1.1.0 instead of 
http://karaf.apache.org/xmlns/features/v1.0.0), which effectively makes 
the generated features incompatible with the 2.2.9 version of Karaf.

Is this correct?

If so, what can be done to remedy the situation?

best regards, Peter

Re: karaf-maven-plugin started producing features with a new namespace (incompatible with Karaf 2.2.9)

Posted by "peter.gardfjall.work" <pe...@gmail.com>.
Thanks for the info Brian,

I also find the plugin useful.
I've been happy with the plugin (the trunk (3.0.x) one) until it started 
producing feature descriptors that aren't compatible with Karaf 2.2.x.
I hope that the plugin will survive in the long run.

Until KARAF-1764 has been resolved I will include an ugly antrun 
replace-task in my feature build that simply replaces the (incompatible) 
namespace with the old one in the generated features.xml file.


<!--
         FIXME: temporary fix for 
https://issues.apache.org/jira/browse/KARAF-1764
           Add a post-compile step that replaces feature namespace version
           with one that is compatible with Karaf 2.2.x.
         -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<replace file="target/feature/feature.xml" 
token="http://karaf.apache.org/xmlns/features/v1.1.0" 
value="http://karaf.apache.org/xmlns/features/v1.0.0"/>
</target>
</configuration>
</execution>
</executions>
</plugin>


Ugly, but it does its job.

best regards, Peter


On 08/23/2012 02:03 PM, Brian Topping wrote:
> Peter,
>
> Just so you know, the karaf-maven-plugin development is quite a bit in flux.  I started doing a lot of work on it, but it was said that it was easy enough to just develop features descriptors by hand and that plugin development wasn't essential.  You can refer to the thread if you like, but I'm really not happy with where the plugin is or the output that it generates.
>
> I'm saying this so you can avoid a lot of frustration with it.  I did a lot of work on it and still don't find it usable.
>
> Until it gets fixed (and I'm very eager to get it fixed because I disagree with the statements about the plugin being unimportant), the best thing to do is to put your features descriptor in your resources folder, make sure resource filtering is enabled, then use build-helper-maven-plugin to attach the feature artifact to the build from the target/classes folder so you get what you expect as the final deployed artifact.
>
> I'm sure this will eventually get fixed, and I put in all the unit tests so that there could be a community discussion on what features should and should not be supported, but it's just not there yet.
>
> Cheers, Brian
>
> On Aug 23, 2012, at 2:52 PM, peterg<pe...@gmail.com>  wrote:
>
>> I've opened a Jira issue to track this issue:
>> https://issues.apache.org/jira/browse/KARAF-1764.
>>
>> best regards, Peter
>>
>>
>>
>> --
>> View this message in context: http://karaf.922171.n3.nabble.com/karaf-maven-plugin-started-producing-features-with-a-new-namespace-incompatible-with-Karaf-2-2-9-tp4025746p4025797.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.


Re: karaf-maven-plugin started producing features with a new namespace (incompatible with Karaf 2.2.9)

Posted by Brian Topping <to...@codehaus.org>.
Peter,

Just so you know, the karaf-maven-plugin development is quite a bit in flux.  I started doing a lot of work on it, but it was said that it was easy enough to just develop features descriptors by hand and that plugin development wasn't essential.  You can refer to the thread if you like, but I'm really not happy with where the plugin is or the output that it generates.

I'm saying this so you can avoid a lot of frustration with it.  I did a lot of work on it and still don't find it usable.

Until it gets fixed (and I'm very eager to get it fixed because I disagree with the statements about the plugin being unimportant), the best thing to do is to put your features descriptor in your resources folder, make sure resource filtering is enabled, then use build-helper-maven-plugin to attach the feature artifact to the build from the target/classes folder so you get what you expect as the final deployed artifact.

I'm sure this will eventually get fixed, and I put in all the unit tests so that there could be a community discussion on what features should and should not be supported, but it's just not there yet.

Cheers, Brian

On Aug 23, 2012, at 2:52 PM, peterg <pe...@gmail.com> wrote:

> I've opened a Jira issue to track this issue:
> https://issues.apache.org/jira/browse/KARAF-1764.
> 
> best regards, Peter
> 
> 
> 
> --
> View this message in context: http://karaf.922171.n3.nabble.com/karaf-maven-plugin-started-producing-features-with-a-new-namespace-incompatible-with-Karaf-2-2-9-tp4025746p4025797.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


Re: karaf-maven-plugin started producing features with a new namespace (incompatible with Karaf 2.2.9)

Posted by peterg <pe...@gmail.com>.
I've opened a Jira issue to track this issue:
https://issues.apache.org/jira/browse/KARAF-1764.

best regards, Peter



--
View this message in context: http://karaf.922171.n3.nabble.com/karaf-maven-plugin-started-producing-features-with-a-new-namespace-incompatible-with-Karaf-2-2-9-tp4025746p4025797.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: karaf-maven-plugin started producing features with a new namespace (incompatible with Karaf 2.2.9)

Posted by "peter.gardfjall.work" <pe...@gmail.com>.
Hi Jean-Baptiste,

as I said, the main reason for using the 3.x branch is that it allows me 
to exclude transitive dependencies: the
includeTransitiveDependency flag. See 
https://issues.apache.org/jira/browse/KARAF-931

Maybe that flag can be back-ported to the features-maven-pluing in the 
2.x branches?

best regards, Peter


On 08/21/2012 04:30 PM, Jean-Baptiste Onofré wrote:
> Correct,
>
> the XSD have changed between 2.2.x/2.3.x and 3.0.0. The 3.0.0 branch 
> contains new attributes which are not supported by 2.2.x/2.3.x branches.
>
> However, most of the karaf-maven-plugin features are available in the 
> features-maven-plugin of 2.2.x/2.3.x branches.
>
> Which are the issues that you have that "force" you to use 3.0.0 ?
>
> Thanks,
> Regards
> JB
>
> On 08/21/2012 10:41 AM, peter.gardfjall.work wrote:
>> Hi all,
>>
>> I'm using the karaf-maven-plugin
>> (org.apache.karaf.tooling:karaf-maven-plugin:3.0.0-SNAPSHOT) to generate
>> feature descriptors and kar files.
>> Note that although I am _running_ these features on a 2.2.9 version of
>> Karaf, I'm using the 3.0.0-SNAPSHOT to _generate_ the features, the main
>> reason being that the plugin on the 3.0.0 branch has some nice features
>> (such as being able to exclude transitive dependencies -- the
>> includeTransitiveDependency flag).
>>
>> If I am correct, a recent commit on the 3.0.0 branch has resulted in the
>> karaf-maven-plugin now producing feature descriptors with a new
>> namespace ( http://karaf.apache.org/xmlns/features/v1.1.0 instead of
>> http://karaf.apache.org/xmlns/features/v1.0.0), which effectively makes
>> the generated features incompatible with the 2.2.9 version of Karaf.
>>
>> Is this correct?
>>
>> If so, what can be done to remedy the situation?
>>
>> best regards, Peter
>


Re: karaf-maven-plugin started producing features with a new namespace (incompatible with Karaf 2.2.9)

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

the XSD have changed between 2.2.x/2.3.x and 3.0.0. The 3.0.0 branch 
contains new attributes which are not supported by 2.2.x/2.3.x branches.

However, most of the karaf-maven-plugin features are available in the 
features-maven-plugin of 2.2.x/2.3.x branches.

Which are the issues that you have that "force" you to use 3.0.0 ?

Thanks,
Regards
JB

On 08/21/2012 10:41 AM, peter.gardfjall.work wrote:
> Hi all,
>
> I'm using the karaf-maven-plugin
> (org.apache.karaf.tooling:karaf-maven-plugin:3.0.0-SNAPSHOT) to generate
> feature descriptors and kar files.
> Note that although I am _running_ these features on a 2.2.9 version of
> Karaf, I'm using the 3.0.0-SNAPSHOT to _generate_ the features, the main
> reason being that the plugin on the 3.0.0 branch has some nice features
> (such as being able to exclude transitive dependencies -- the
> includeTransitiveDependency flag).
>
> If I am correct, a recent commit on the 3.0.0 branch has resulted in the
> karaf-maven-plugin now producing feature descriptors with a new
> namespace ( http://karaf.apache.org/xmlns/features/v1.1.0 instead of
> http://karaf.apache.org/xmlns/features/v1.0.0), which effectively makes
> the generated features incompatible with the 2.2.9 version of Karaf.
>
> Is this correct?
>
> If so, what can be done to remedy the situation?
>
> best regards, Peter

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