snippetbashTip
mvn — Apache Maven: build and manage Java-based projects. More information: <https://manned.org/mvn>.
Viewed 0 times
commandbuildmavenandcliapachemanagemvn
Problem
How to use the
mvn command: Apache Maven: build and manage Java-based projects. More information: <https://manned.org/mvn>.Solution
mvn — Apache Maven: build and manage Java-based projects. More information: <https://manned.org/mvn>.Compile a project:
mvn compileCompile and package the compiled code in its distributable format, such as a
jar:mvn packageCompile and package, skipping unit tests:
mvn package {{[-D|--define]}} skipTestsInstall the built package in local maven repository. (This will invoke the compile and package commands too):
mvn installDelete build artifacts from the target directory:
mvn cleanDo a clean and then invoke the package phase:
mvn clean packageClean and then package the code with a given build profile:
mvn clean {{[-P|--activate-profiles]}} {{profile}} packageRun a class with a main method:
mvn exec:java {{[-D|--define]}} exec.mainClass="{{com.example.Main}}" {{[-D|--define]}} exec.args="{{argument1 argument2 ...}}"Code Snippets
Compile a project
mvn compileCompile and package the compiled code in its distributable format, such as a `jar`
mvn packageCompile and package, skipping unit tests
mvn package {{[-D|--define]}} skipTestsInstall the built package in local maven repository. (This will invoke the compile and package commands too)
mvn installDelete build artifacts from the target directory
mvn cleanContext
tldr-pages: common/mvn
Revisions (0)
No revisions yet.