How to control war submodules build order in Maven?

Viewed 19

I have a multi-module project, for eg:

ROOT
 L_ A
 |   L_ A1 (jar)
 |   L_ A2 (pom)
 L_ B
     L_ B1 (jar)
     L_ B2 (war)

The ROOT always loads the module A in the reactor and there is a profile that loads the module B.

My problem is their build order. The module A2 is using maven-assembly-plugin to copy the war and other files to a folder. The order I need would be A1 > B1 > B2 > A2. How can I get this?

I can't put the B modules inside A2 - Maven complains the B modules are duplicate since they are loaded by another profile already. I can put B1 as a dependency of the assembly plugin and so move the build of A2 after B1. But I can't put B2 as a dependency because it is not a jar, I get an error.

0 Answers
Related