mvn

Apache Maven. Tool for building and managing Java-based projects.

Install

All systems
curl cmd.cat/mvn.sh
Debian Debian
apt-get install xmvn-minimal
Ubuntu
apt-get install xmvn-minimal
Arch Arch Linux
pacman -S xmvn-minimal
image/svg+xml Kali Linux
apt-get install xmvn-minimal
CentOS
yum install xmvn-minimal
Fedora
dnf install xmvn-minimal
OS X
brew install xmvn-minimal
Raspbian
apt-get install xmvn-minimal

Apache Maven. Tool for building and managing Java-based projects.

  • Compile a project:
    mvn compile
  • Compile and package the compiled code in its distributable format, such as a `jar`:
    mvn package
  • Compile and package, skipping unit tests:
    mvn package -Dmaven.test.skip=true
  • Install the built package in local maven repository. (This will invoke the compile and package commands too):
    mvn install
  • Delete build artifacts from the target folder:
    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 -Pprofile package
  • Run a class with a main method:
    mvn exec:java -Dexec.mainClass="com.example.Main" -Dexec.args="arg1 arg2"

© tl;dr; authors and contributors