'Execute a Maven phase without the previous ones

Can I execute a Maven phase (say: deploy) without implicitly calling the previous ones?

The reason: I would like to construct something like install site-deploy (only-deploy) to make sure that the deployment of the artifact only happens if all other phases/goals were successful. I cannot replace (only-deploy) with deploy:deploy because some projects which use this configuration have additional goals in the deploy phase.



Solution 1:[1]

It's (now) possible:

To run a specific goal without executing its entire phase (and the preceding phases), we can use the command:

mvn <PLUGIN>:<GOAL>

For example, to run the integration-test goal from the Failsafe plugin, we need to run:

mvn failsafe:integration-test

another example: mvn compiler:compile

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Andreas Covidiot