tldr/pages/common/mvn.md
Marco Bonelli 2599a6de48 Refactor: change "folder" to "directory" where needed.
This commit fixes every instance in which the word "folder" is
incorrectly used instead of "directory".
2019-02-13 20:51:04 +05:30

781 B

mvn

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 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{{profile}} package

  • Run a class with a main method:

mvn exec:java -Dexec.mainClass="{{com.example.Main}}" -Dexec.args="{{arg1 arg2}}"