You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ryan Moquin <fr...@gmail.com> on 2007/12/02 19:35:26 UTC

A question about advanced assembly plugin usage (or if there is a better way)

I was wondering if anyone has tried to use the assembly plugin to merge
modified configuration files with a distribution .zip from an external
project output.  In other words, if I had a zip file that was a distribution
from another project, such as a tomcat bundle that includes a couple
webapps,  and I wanted to maintain a couple separate configuration files,
what's the best way to merge those into that zip distribution?  I'm trying
to maintain these files separately for version upgrades of the external zip
file.

Basically, I currently have a maven2 subproject and am using that to prepare
those specific config files and then want to merge them into that zip file.
I would also like to prepare the zip file by deleting a directory or two and
then overwriting some files with my own.  Is this something I can do with
the assembly plugin?  My thoughts were to unzip the 3rd party zip file, then
specify that as a fileset first in my assembly descriptor, then specify my
modified files second in the hopes they'll overwrite the others.  I'm not
sure how I would go about deleting files though.

I could do some of this manually, I mean really I could prepare the other
zip file manually in a minute or two, but I'm more worried about mistakes.
I also want to create several versions of that zip file including different
configuration files.

Has anyone tried anything like this?  Am I making sense?  Really I just want
to manipulate a 3rd party zip file from maven2, by deleting some files from
it, overwriting some files and adding some dependencies from my other
project to it and then zipping it back up.

Thanks for any input!

Re: A question about advanced assembly plugin usage (or if there is a better way)

Posted by Kalle Korhonen <ka...@gmail.com>.
Yes, this is quite normal, at least in my projects. Use depedency:unpack to
unpack the modules, then assembly fileset to overwrite specific
configuration files and then re-assemble the project. Numerous threads on
that, search the archives.

Kalle


On 12/2/07, Ryan Moquin <fr...@gmail.com> wrote:
>
> I was wondering if anyone has tried to use the assembly plugin to merge
> modified configuration files with a distribution .zip from an external
> project output.  In other words, if I had a zip file that was a
> distribution
> from another project, such as a tomcat bundle that includes a couple
> webapps,  and I wanted to maintain a couple separate configuration files,
> what's the best way to merge those into that zip distribution?  I'm trying
> to maintain these files separately for version upgrades of the external
> zip
> file.
>
> Basically, I currently have a maven2 subproject and am using that to
> prepare
> those specific config files and then want to merge them into that zip
> file.
> I would also like to prepare the zip file by deleting a directory or two
> and
> then overwriting some files with my own.  Is this something I can do with
> the assembly plugin?  My thoughts were to unzip the 3rd party zip file,
> then
> specify that as a fileset first in my assembly descriptor, then specify my
> modified files second in the hopes they'll overwrite the others.  I'm not
> sure how I would go about deleting files though.
>
> I could do some of this manually, I mean really I could prepare the other
> zip file manually in a minute or two, but I'm more worried about mistakes.
> I also want to create several versions of that zip file including
> different
> configuration files.
>
> Has anyone tried anything like this?  Am I making sense?  Really I just
> want
> to manipulate a 3rd party zip file from maven2, by deleting some files
> from
> it, overwriting some files and adding some dependencies from my other
> project to it and then zipping it back up.
>
> Thanks for any input!
>