Maven is a build automation tool used primarily for Java projects. The word maven means ‘accumulator of knowledge’ in Yiddish. Maven addresses two aspects of building software: First, it describes how software is built, and second, it describes its dependencies.

Maven’s Objectives

  • Making the build process easy
  • Providing a uniform build system
  • Providing quality project information
  • Providing guidelines for best practices development
  • Allowing transparent migration to new features

Here I am mentioning some useful commands that generally use while working with maven.

  • mvn clean :-  Use to clean a project.
  • mvn compile :-  Use to compile a project.
  • mvn tomcat7:run :-Use to run tomcat7.
  • mvn test :-  It use to  test and compile a project.
  • mvn package :-  Use to build a package (it also executes unit tests).
  • mvn verify :-  Use to run integration test (it also builds a package)
  • mvn install :-  Install a package into local repository (it also executes integration tests).
  • mvn -DskipITs=true install :-  Install an artifact into local repository (skip integration test execution).
  • mvn -DskipTests=true install :-  Install an artifact into local repository (skip unit and integration test execution)
  • mvn –Dmaven.test.skip=true :-  Install an artifact into local repository (skip compiling test and test execution).
  • mvn deploy :-  Deploy artifact into enterprise repository.
  • mvn help :-  To Display help.
  • mvn dependency:tree :-  Display project dependencies.
  • mvn versions:display-plugin-updates :-  Check plugins for newer versions.
  • mvn versions:display-dependency-updates :-Check dependencies for newer versions.