You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Lars Kiesow <lk...@uos.de> on 2015/09/25 16:40:50 UTC

Configure Karaf Maven Plugin

Hi everyone,
I found in the (deprecated old style) Maven assembly docs [1] that is is
possible to define things like the output archive format and what to
package as start scripts. At least it seems like that.

Is there any kind of documentation for configuring the Karaf Maven
Plugin? I am especially interested in:

 - Specifying output formats since we do not need a zip files and would
   even prefer to just have the assembly not archived in one sub-folder.

 - Can I get rid of the Windows start scripts in particular or specify
   which files are put into /bin in general?

I hope someone knows more about this.

Best regards,
Lars

[1]
http://karaf.apache.org/manual/latest-3.0.x/developers-guide/custom-distribution.html

Re: Configure Karaf Maven Plugin

Posted by Lars Kiesow <lk...@uos.de>.
Hi Markus,
I now have what I want (yay!) as a combination of the
karaf-maven-plugin, the maven-antrun-plugin and finally the
maven-assembly-plugin. They now work like this:

 - Create the default Karaf assembly (including the archives but we
   just ignore them)

 - Filter some automatically generated configuration files (at the
   moment only the startup.properties but that might change)

 - Create an updated assembly, including additional configuration,
   excluding some unnecessary parts, ... and overwrize the archives.

The pom.xml:     http://paste.fedoraproject.org/271994/14433708
The package.xml: http://paste.fedoraproject.org/271995/44337087

Thanks for the idea :)

Still, I think it would be great to have some configuration options in
the Karaf Maven plugin.

Best regards,
Lars


On Sat, 26 Sep 2015 17:01:20 +0200
Markus Rathgeb <ma...@gmail.com> wrote:

> > Do you mind sharing yur maven
> > configuration so that I have an example of how to do that?
> 
> https://github.com/maggu2810/openhab2/tree/master-for-karaf/distributions
> 
> * openhab2-runtime-karaf is using the karaf-maven-plugin
> * openhab2-runtime is using the artifact of the previous one, the
> maven-assembly-plugin etc.


Re: Configure Karaf Maven Plugin

Posted by Rodrigo Serra <ro...@jlab.com.ar>.
Great!!, it works and with archiveZip=false the build time decrease to ~60%. Thank for share this.

Best regards,
Rodrigo

> El 16 oct 2015, a las 16:36, Lars Kiesow <lk...@uos.de> escribió:
> 
> Hi,
> just as follow-up (if someone is trying to do the same thing), by
> looking at the code for the karaf-maven-plugin I found out that there
> are actually some undocumented configuration options which let you
> control the output formats:
> 
>  <plugin>
>   <artifactId>karaf-maven-plugin</artifactId>
>   ...
>   <configuration>
>     <archiveZip>false</archiveZip>
>     <archiveTarGz>false</archiveTarGz>
>   </configuration>
>  </plugin>
> 
> For my distribution I still use the maven-assembly-plugin afterwards
> since that gives me more control about the assembly. Still, turning the
> archiving off made things a bit faster.
> 
> Maybe this information is useful for someone else as well.
> 
> Best regards, 
> Lars
> 
> 
> On Sun, 27 Sep 2015 18:30:40 +0200
> Lars Kiesow <lk...@uos.de> wrote:
> 
>> Hi Markus,
>> I now have what I want (yay!) as a combination of the
>> karaf-maven-plugin, the maven-antrun-plugin and finally the
>> maven-assembly-plugin. They now work like this:
>> 
>> - Create the default Karaf assembly (including the archives but we
>>   just ignore them)
>> 
>> - Filter some automatically generated configuration files (at the
>>   moment only the startup.properties but that might change)
>> 
>> - Create an updated assembly, including additional configuration,
>>   excluding some unnecessary parts, ... and overwrize the archives.
>> 
>> The pom.xml:     http://paste.fedoraproject.org/271994/14433708
>> The package.xml: http://paste.fedoraproject.org/271995/44337087
>> 
>> Thanks for the idea :)
>> 
>> Still, I think it would be great to have some configuration options in
>> the Karaf Maven plugin.
>> 
>> Best regards,
>> Lars
>> 
>> 
>> On Sat, 26 Sep 2015 17:01:20 +0200
>> Markus Rathgeb <ma...@gmail.com> wrote:
>> 
>>>> Do you mind sharing yur maven
>>>> configuration so that I have an example of how to do that?
>>> 
>>> https://github.com/maggu2810/openhab2/tree/master-for-karaf/distributions
>>> 
>>> * openhab2-runtime-karaf is using the karaf-maven-plugin
>>> * openhab2-runtime is using the artifact of the previous one, the
>>> maven-assembly-plugin etc.
>> 
> 


Re: Configure Karaf Maven Plugin

Posted by Lars Kiesow <lk...@uos.de>.
Hi,
just as follow-up (if someone is trying to do the same thing), by
looking at the code for the karaf-maven-plugin I found out that there
are actually some undocumented configuration options which let you
control the output formats:

  <plugin>
   <artifactId>karaf-maven-plugin</artifactId>
   ...
   <configuration>
     <archiveZip>false</archiveZip>
     <archiveTarGz>false</archiveTarGz>
   </configuration>
  </plugin>

For my distribution I still use the maven-assembly-plugin afterwards
since that gives me more control about the assembly. Still, turning the
archiving off made things a bit faster.

Maybe this information is useful for someone else as well.

Best regards, 
Lars


On Sun, 27 Sep 2015 18:30:40 +0200
Lars Kiesow <lk...@uos.de> wrote:

> Hi Markus,
> I now have what I want (yay!) as a combination of the
> karaf-maven-plugin, the maven-antrun-plugin and finally the
> maven-assembly-plugin. They now work like this:
> 
>  - Create the default Karaf assembly (including the archives but we
>    just ignore them)
> 
>  - Filter some automatically generated configuration files (at the
>    moment only the startup.properties but that might change)
> 
>  - Create an updated assembly, including additional configuration,
>    excluding some unnecessary parts, ... and overwrize the archives.
> 
> The pom.xml:     http://paste.fedoraproject.org/271994/14433708
> The package.xml: http://paste.fedoraproject.org/271995/44337087
> 
> Thanks for the idea :)
> 
> Still, I think it would be great to have some configuration options in
> the Karaf Maven plugin.
> 
> Best regards,
> Lars
> 
> 
> On Sat, 26 Sep 2015 17:01:20 +0200
> Markus Rathgeb <ma...@gmail.com> wrote:
> 
> > > Do you mind sharing yur maven
> > > configuration so that I have an example of how to do that?
> > 
> > https://github.com/maggu2810/openhab2/tree/master-for-karaf/distributions
> > 
> > * openhab2-runtime-karaf is using the karaf-maven-plugin
> > * openhab2-runtime is using the artifact of the previous one, the
> > maven-assembly-plugin etc.
> 


Re: Configure Karaf Maven Plugin

Posted by Markus Rathgeb <ma...@gmail.com>.
> Do you mind sharing yur maven
> configuration so that I have an example of how to do that?

https://github.com/maggu2810/openhab2/tree/master-for-karaf/distributions

* openhab2-runtime-karaf is using the karaf-maven-plugin
* openhab2-runtime is using the artifact of the previous one, the
maven-assembly-plugin etc.

Re: Configure Karaf Maven Plugin

Posted by Lars Kiesow <lk...@uos.de>.
Hi Markus,
doing the adjustments after creating the assembly could be a possible
way if there is no more direct one. Do you mind sharing yur maven
configuration so that I have an example of how to do that?
Regards,
Lars


On Sat, 26 Sep 2015 12:14:24 +0200
Markus Rathgeb <ma...@gmail.com> wrote:

[...]
> After that I have another artifact that depend on this one, that is
> using the maven-assembly-plugin and so on,
[...]

Re: Configure Karaf Maven Plugin

Posted by Markus Rathgeb <ma...@gmail.com>.
I do not find a way to do that all stuff usong the karaf-maven-plugin. I am
using the karaf-maven-plugin to do what it is currently doing (and doing it
good). After that I have another artifact that depend on this one, that is
using the maven-assembly-plugin and so on, and doing all the remaining
stuff (e.g. what you could see in the deprecated docu).
It is working good