Maven – question on mvn -e clean install

mavenmaven-2

In maven, what does "-e" stands for in the following command.

mvn -e clean install

Moreover, what is the difference between

mvn clean install  

and

mvn clean compile

Best Answer

As Satish stated, the "-e" switch will display execution errors in the maven output.

As to the difference in "install" vs "compile", those are different Maven lifecycle stages. See the Introduction to the Build Lifecycle documentation for help with that. The key to remember is that Maven will execute all lifecycle stages up to and including the one you specify, and then stop.

Specifically in your case, "mvn clean compile" will run Maven with two lifecycle targets, the first being "clean", and the second being "compile". The "compile" lifecycle phase will run the build up to and including the compilation of project source code. The "install" lifecycle phase will run all the way through packaging your project into it's container (jar, war, etc) and will install it to your local maven repository, which resides on your local machine. When a project is installed to your local repository, other projects you build on your machine can reference it without having to have any knowledge of where the source code or project build artifacts actually reside.