Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences Between mvn install and mvn verify

What are the differences between Maven's mvn install and mvn verify commands?

How does the keyword clean modify these commands?

like image 621
Nicholas Avatar asked May 09 '18 19:05

Nicholas


2 Answers

mvn verify - as said before - performs any integration tests that maven finds in the project.

mvn install implicitly runs mvn verify and then copies the resulting artifact into your local maven repository which you usually can find under C:\Users\username\.m2\repository if you are using windows.

If you run maven multiple times without the clean command and without changing any source code, you may notice that it says Nothing to compile - all classes are up to date during the compile phase. If you add the clean command before any other command, maven will simply delete the entire target directory resulting in all classes being recompiled.

like image 176
vatbub Avatar answered Sep 20 '22 08:09

vatbub


From https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html:

mvn install - install the package into the local repository, for use as a dependency in other projects locally

mvn verify - run any checks on results of integration tests to ensure quality criteria are met

clean is a lifecycle that handles project cleaning. Commands involving clean before it will clear the entire directory, meaning that all the classes have to be recompiled.

like image 23
Ṃųỻịgǻňạcểơửṩ Avatar answered Sep 20 '22 08:09

Ṃųỻịgǻňạcểơửṩ