Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 771
Leonid Avatar asked May 16 '11 14:05

Leonid


People also ask

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

5 Answers. Show activity on this post. 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 is the difference between mvn clean install and mvn clean package?

mvn package command will compile source code and also package it as a jar or war as per pom file and put it into the target folder(by default). mvn install command will compile and package, but it will also put the package in your local repository.

What is the difference between mvn install and mvn package?

mvn package: Creates JAR or WAR file for the project to convert it into a distributable format. mvn install: Deploys the packaged JAR/ WAR file to the local repository.


1 Answers

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.

like image 189
Powerlord Avatar answered Oct 07 '22 15:10

Powerlord