'Execute maven install phase without executing maven compile

Working with a multi-module project. Want to run maven commands as follows:

mvn clean compile

Then maven install phase without again executing maven compile



Solution 1:[1]

Not possible.

You would need to call the goals directly, phases cannot be run separately.

Solution 2:[2]

you can (now) skip phases by directly calling the goal via

mvn <plugin>:<goal>

e.g.

mvn compiler:compile

see this answer for details.

for install it should be mvn install:install

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 J Fabian Meier
Solution 2 Andreas Covidiot