LinuxCommandLibrary

mvn

TLDR

Build project

$ mvn package
copy
Clean and build
$ mvn clean install
copy
Run tests
$ mvn test
copy
Skip tests
$ mvn install -DskipTests
copy
Generate project
$ mvn archetype:generate
copy
Deploy to repository
$ mvn deploy
copy
Show dependency tree
$ mvn dependency:tree
copy
Update dependencies
$ mvn versions:display-dependency-updates
copy

SYNOPSIS

mvn [options] [goals]

DESCRIPTION

mvn is the Apache Maven build tool. It manages Java project builds and dependencies.
The tool uses POM files for configuration. Handles compilation, testing, and packaging.
mvn is Maven build automation.

PARAMETERS

GOALS

Build goals to execute.
clean
Remove target directory.
compile
Compile sources.
test
Run tests.
package
Build JAR/WAR.
install
Install to local repo.
-D PROPERTY
Set system property.
--help
Display help information.

CAVEATS

Requires pom.xml. Downloads dependencies. JDK required.

HISTORY

Maven was created by Apache in 2004 to provide standardized Java project builds and dependency management.

SEE ALSO

gradle(1), ant(1), java(1)

Copied to clipboard