I just started using Maven and I was told to do mvn install in a specific directory.
What does mvn install do, exactly?
I think it looks for pom.xml in the current folder and starts following the instructions specified in that file. Is that correct?
As you might be aware of, Maven is a build automation tool provided by Apache which does more than dependency management. We can make it as a peer of Ant and Makefile which downloads all of the dependencies required.
On a
mvn install, it frames a dependency tree based on the project configurationpom.xmlon all the sub projects under the superpom.xml(the root POM) and downloads/compiles all the needed components in a directory called.m2under the user’s folder. These dependencies will have to be resolved for the project to be built without any errors, andmvn installis one utility that could download most of the dependencies.Further, there are other utils within Maven like
dependency:resolvewhich can be used separately in any specific cases. The build life cycle of the mvn is as below: LifeCycle Bindingsprocess-resourcescompileprocess-test-resourcestest-compiletestpackageinstalldeployThe test phase of this mvn can be ignored by using a flag
-DskipTests=true.