Search code examples
mavenmaven-invoker-plugin

Invoke maven-invoker-plugin in a specific phase


Is it possible to execute goal of maven-invoker-plugin in a specific phase only? I want the goal to execute only when i run 'mvn verify' and not when 'mvn install' is run.


Solution

  • Running mvn with a specific phase will run the lifecycle up to that phase. This means that mvn install will run all phases including install. This means that mvn install will always run verify as well. So you cannot achieve what you want to achive.

    But maybe if you give more information about your ultimate goal, it will be possible to find a solution that works for you.