Maven Commands every developer needs to know

Maven Commands every developer needs to know

Cheatsheet

·

1 min read

Play this article

Below are some of the important Maven commands we need to know in software development.

Compile source code

mvn compile

Clean old build files

mvn clean

Deploy the JAR/WAR files in local

mvn install

Deploy the JAR/WAR files in remote

mvn deploy

Run the tests

mvn test

Check the maven dependency tree

mvn dependency:tree

Create a JAR/WAR package

mvn package

Skip the tests and clean install

mvn clean install -DskipTests=true

Run spring boot app

mvn spring-boot:run

Setup project for Intellij IDEA

mvn idea:idea

Test with multiple params

mvn test -DskipTests=true -DsuiteXmlFile=<xml-file-path> -DapplicationHostname=<host-name> -DapplicationProtocol=<protocol-name> -DapplicationPort=<port-number>