1

I have a some maven projects that generate a zip with the maven assembly plugins (each project builds its own zip).

Now I have another project that is just a multi module project, referencing the other projects. I want this project to generate a zip with the contents of the submodules zips.

How is this possible? I don't know how to configure the assembly plugin for the multimodule project.

To clarify, I have these projects

Submodule1
Submodule2
Mainmodule

The submodules generate these zip-file with the assembly-plugin:

Submodule1:
  {Submodule1.jar, 
   dependency1.jar, 
   dependency2.jar, 
   someotherfile.txt}

Submodule2:
  {Submodule2.jar, 
   dependency3.jar, 
   evenanotherfile.txt}

And I want the main module to generate this zip:

Mainmodule:
  {Submodule1.jar, 
   dependency1.jar, 
   dependency2.jar, 
   someotherfile.txt
   Submodule2.jar, 
   dependency3.jar, 
   evenanotherfile.txt}

EDIT: Regarding the "duplicate": This question has nothing to do with creating multiple assemblies from one maven project. I have multiple maven projects, each of them builds its own assembly. Then I have another (multii module) project, that builds its own assembly (but this assembly should contain the contents of the submodules assemblies)

radlan
  • 2,393
  • 4
  • 33
  • 53
  • Possible duplicate of [Multiple assemblies from one maven project](http://stackoverflow.com/questions/12727612/multiple-assemblies-from-one-maven-project) – ozOli Apr 11 '16 at 07:20
  • @ozOli I do not see how you identify a duplilcate to your referenced question? I do not want to create multiple assemblies from one maven project. I have multiple maven projects, each of them builds its own assembly. Then I have another (multii module) project, that builds its own assembly (but this assembly should contain the contents of the submodules assemblies). – radlan Apr 11 '16 at 07:22
  • A JAR is a ZIp file so creating a assemblies or JARs or ZIPs. Use the dependencies tag linked in the duplicate link to specify the exact dependencies to include in your ZIP. The executor tag could also be useful. – ozOli Apr 11 '16 at 08:26
  • Take a look into [this example which shows how to make](https://github.com/khmarbaise/assembly-examples/tree/master/assemblies-of-assemblies) zip of zip's ... – khmarbaise Apr 11 '16 at 08:40
  • 1
    @khmarbaise I have two issues with this approach: 1. Is there a way to unpack the attached zip-files prior to packaging them? I want _the contents_ of these zips to be packaged, not the zips themselves. 2. If e.g. package-1 defines some dependencies on external jars, these jars are included in the overall zip as well. I only want the content of the zip-files, not any dependency-jars. – radlan Apr 11 '16 at 11:50

0 Answers0