Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between "mvn clean install" & "mvn eclipse:clean eclipse:eclipse" command?

Tags:

I have a maven project in eclipse. I use mvn clean install for installing dependencies in pom.xml.

I want to know what mvn eclipse:clean eclipse:eclipse command does and also the difference between these two?

like image 336
Dev Avatar asked Jun 12 '15 14:06

Dev


People also ask

What is the meaning of mvn clean install?

The short answer mvn clean install is the command to do just that. You are calling the mvn executable, which means you need Maven installed on your machine. (see How do you install Maven?) You are using the clean command, which will delete all previously compiled Java . class files and resources (like .

What is 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.

What does mvn clean do?

The Maven Clean Plugin, as the name implies, attempts to clean the files and directories generated by Maven during its build. While there are plugins that generate additional files, the Clean Plugin assumes that these files are generated inside the target directory.

What does mvn install file do?

The mvn install command runs the install plugin used in the install phase to add artifact(s) to the local repository. The Install Plugin uses the information in the POM (groupId, artifactId, version) to determine the proper location of the artifact within the local repository.


1 Answers

mvn eclipse:clean eclipse:eclipse
The second command is completely different from the first one.
First, it deletes previously generated Eclipse files (like .project and .classpath and .settings) and then generates new ones, thus, effectively updating them. It may be useful if you introduced some changes in pom.xml (like new dependencies or plugins) and want Eclipse to be aware of them.

mvn clean install
The first command deletes target directory and then builds all you code and installs artifacts into local repository.

like image 90
madhead - StandWithUkraine Avatar answered Sep 24 '22 17:09

madhead - StandWithUkraine