commands.sh

mvn

all

Apache Maven: build and manage Java-based projects.

More info →

Options (2)

-D, --defineboolean

Compile and package, skipping unit tests

Example: mvn package {{[-D|--define]}} skipTests
-P, --activate-profilesboolean

Clean and then package the code with a given build profile

Example: mvn clean {{[-P|--activate-profiles]}} {{profile}} package

Examples (8)

Compile a project

Compile and package the compiled code in its distributable format, such as a `jar`

Compile and package, skipping unit tests

mvn package [-D|--define] skipTests

Install the built package in local maven repository. (This will invoke the compile and package commands too)

Delete build artifacts from the target directory

mvn clean

Do a clean and then invoke the package phase

mvn clean package

Clean and then package the code with a given build profile

mvn clean [-P|--activate-profiles] profile package

Run a class with a main method

mvn exec:java [-D|--define] exec.mainClass="com.example.Main" [-D|--define] exec.args="argument1 argument2 ..."
made by @shridhargupta | data from tldr-pages