How is "mvn clean install" different from "mvn install"?

Leonid picture Leonid · May 16, 2011 · Viewed 277k times · Source

What is the difference between mvn clean install and mvn install?

Answer

Powerlord picture Powerlord · May 16, 2011

clean is its own build lifecycle phase (which can be thought of as an action or task) in Maven. mvn clean install tells Maven to do the clean phase in each module before running the install phase for each module.

What this does is clear any compiled files you have, making sure that you're really compiling each module from scratch.