Subcommands (8)
Generate a new Maven project from a predefined template (archetype).
Compile a Maven project's source code.
Manage and analyze Maven project dependencies. Provides goals for viewing, resolving, and copying project dependencies.
Add an artifact to a remote repository.
Generate IntelliJ IDEA project files (`.ipr`, `.iml`, and `.iws`) for a Maven project. Note: This plugin is retired. It is no longer maintained.
Install third-party Maven dependencies and build the project.
Package the compiled code of a Maven project into its distributable format (such as a `.jar` or `.war`).
Generate a project website based on the information in the `pom.xml` file.
Options (2)
-D, --definebooleanCompile and package, skipping unit tests
mvn package {{[-D|--define]}} skipTests-P, --activate-profilesbooleanClean and then package the code with a given build profile
mvn clean {{[-P|--activate-profiles]}} {{profile}} packageExamples (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] skipTestsInstall the built package in local maven repository. (This will invoke the compile and package commands too)
Delete 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 ..."