1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-21 22:42:09 +02:00
tldr/pages/common/mvn.md
Vitor Henrique c8f956319f
pages*: simplify page description (#12149)
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2024-02-14 21:25:13 +01:00

817 B

mvn

Apache Maven: build and manage Java-based projects. More information: https://maven.apache.org.

  • 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 -DskipTests

  • 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="{{argument1 argument2 ...}}"