20
votes

Is there any way to execute a specific phase in a maven build. For example, if I only want to run those plug-ins that execute in the pre-integration-phase, does Maven provide a means to do that?

e.g.
mvn pre-integration-phase
2
Can you give an example where you need that ? Which reason do you have? - khmarbaise
I need this in a build pipeline where we'd like to split up the phases into distinct steps in the build pipeline to better see where errors occur. - Elven Spellmaker

2 Answers

21
votes

You can't call the life-cycle-phase itself but you can call the goals of the plugins which are bound to the life-cycle-phases.

mvn compile:testCompile

mvn failsafe:integration-test

but usually this shouldn't be needed...

4
votes

No. You'd have to run the plugins manually.