When you makes a lot of build using Maven, this is quickly a pain to wait for the end of the build. So this is always good to have solutions to improve the performances of the builds.
The better improvement i found until now is the maven-cli-plugin. This plugin provides an interactive command line interface to launch builds. The improvement is that the first phases of the build are made only once. So multiple builds are really faster. We loose a little time at the first build to make some caching improvements.
With these features, I save a lot of time when I made a lot of builds. For example a simple clean takes sometimes 20 seconds on a big multimodule project. When using the cli, it takes 20 seconds including the time to load the shell for the first time and then it takes only 1 second the make the following cleans. The effect is the same on other phases like install, package, compile, ...
The installation is quite simple. First you must add a plugin group to the settings.xml file :
```xml
mvn cli:execute-phaseWith that the plugin will be downloaded automatically and the next commands will be executed directly. The usage is very easy. This plugin has 2 useful goals :
maven> clean installAnd you can directly add arguments in the command :
maven> clean install -Dmaven.test.skip=trueAnd when you are building a multimodule projects, you can also execute phases only on several modules :
maven> module1 module2 module3 clean installYou can use the ls command in a multi module project to list all the modules of the project. You can use the "Tab" key to auto complete the goals, phases and modules name. When you've finished your builds, you can simply use the "exit" command to exit from the command line. I think it's really a great essential plugin for each person who make Maven builds. More information on the official site.