0

I'm trying to create a end user zip, containing all programs and data in my workspace.

I have a maven project, with many many modules. A few modules use maven-assembly-plugin and output in format "dir". (1)

In my root/parent project i have an assembly (inherited false) to collect all the programs and data (1) from the modules and put it in a nice big zip.

When i do a "mvn package" on my root, maven does a mvn package on my root first and next on all my modules. That is a problem, cause on first "mvn package" the assembly of root project is "made", but the data created by modules assembly is not yet available.

I did read you can't change the order of modules.

Is there a way to delay the assembly of the root until all modules are ready?

Now i simply call "mvn package" on root twice and it works. But that is a bit of a hack.

Tinus Tate
  • 2,237
  • 2
  • 12
  • 33
  • 1
    You should create a module specialized for the assembly. See the linked question. – Tunaki Feb 24 '16 at 16:06
  • @Tunaki thanks, that could indeed work, i will try and move everything to a module and see if i can get it working. – Tinus Tate Feb 24 '16 at 16:33
  • 1
    @Tunaki i can now confirm it works, i moved all the build configuration i had in the root to a new build module. When i now run mvn package on the root, all modules create program and data, and finally the build module assembles everything into a nice zip. – Tinus Tate Feb 24 '16 at 17:46
  • Have you added the dependencies to the other modules so you are sure the assembly module will be build after all other modules.. – khmarbaise Feb 25 '16 at 06:46
  • @khmarbaise yes ;-) That seem to be a way to order the modules. – Tinus Tate Feb 25 '16 at 08:54

0 Answers0