21

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
TERACytE
  • 7,553
  • 13
  • 75
  • 111

2 Answers2

22

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...

khmarbaise
  • 92,914
  • 28
  • 189
  • 235
  • 1
    But when you do `mvn clean install` you are calling the life-cycle-phases directly https://stackoverflow.com/questions/6018701/how-is-mvn-clean-install-different-from-mvn-install – antonro Sep 16 '19 at 07:29
  • 4
    The problem with using `install` is that all phase before are also executed. And the questions was targeting to call just `install` without the previous life cycle phases which is not possible. – khmarbaise Jan 05 '20 at 21:33
4

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

Ryan Stewart
  • 126,015
  • 21
  • 180
  • 199