You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Zanzerkia, Robert" <Ro...@fmr.com> on 2013/03/18 14:22:57 UTC

How to create a zip file for each folder in the project directory (maven-assembly-plugin)

Hi,
 I am setting up a new project with Maven.
 The build task is as follows:
        For each top level folder (package)  under the ${project.build.directory},  zip up all the files under the folder.
        Please note there is NO compilation or build required, just zip up folders...

  Directory looks like below:
   ${project.build.directory}/pkg1
                                        /class
                                        /discoveryjobs
                                        /discoveryModules
                                        /discoveryPatterns
                                        /discoveryScripts
  ${project.build.directory}/pkg2
                                * Structure same as above example *
  ${project.build.directory}/pkg3
                                        * Structure same as above example *

I would like to end up with:
        ${project.build.directory}/target
                                                pkg1.zip (zip of all files in pkg1 folder, incl sub directories)
                                                pkg2.zip
                                                pkg3.zip
Nice to have:
        1) Re-build the zip file ONLY if any sub directory or files have changed.

        2) Create one top level zip file (that contains all pkg*.zip files).
                        uCMDB-PatternDev-0.0.1-SNAPSHOT-distribution.zip

I played with "maven-assembly-plugin" but I have NOT figured out how to iterate over each folder (pkg1, pkg2, pkg3).

I have attached my pom.xml and distribution.xml here.

Is there a way to customize assembly plugin to do what I want?
If NOT are there other plugins? (I experimented with truezip-maven-plugin a little).


Thank you,
Robert




Robert Zanzerkia
Fidelity Investments
FTG-OPS
Two Contra Way
Merrimack, NH 03054

Work: 603-791-3477
Blackberry: 603-320-9682