Vizirship
Vizirship

Reputation: 164

Maven build parent pom last

I've got a parent pom building a bunch of modules, looks like this:

pom.xml
    | project-A / pom.xml
    | project-B / pom.xml
    | project-C / pom.xml

Which results in a build order of

Parent A B C

When I install, I want to run a bunch of ant tasks that are in the parent pom, basically moving the jars in them modules into another directory, which requires the modules to be built first and the the parent to do it's thing. The problem is that the parent pom builds first then builds the modules, which isn't want I want.

The main requirement though is that I have to have it done in the install phase, if thats possible.

How can I make it so that when I run clean install, it runs the ant tasks AFTER the modules have been built and the module's jars are in their target directory?

Upvotes: 2

Views: 1584

Answers (2)

Joinow
Joinow

Reputation: 11

In Linux the order is A,B,C,Parent. That's also a problem for me. It seems Linux and Windows has different fixed order.

Upvotes: 1

Martín Schonaker
Martín Schonaker

Reputation: 7305

Just create a "packager module" that depends on all of the other modules and run your ant tasks there.

Upvotes: 2

Related Questions