Installation
Apache Maven can be installed by most package managers, or manually by downloading the archive and adding it to your path.
Prerequisites
You need a Java Development Kit (JDK) installed. Either set the JAVA_HOME environment variable to the path of your JDK installation or have the java executable on your PATH.
The current stable version 3.9.11 requires JDK 8+, but any recent version will work just fine.
Binary distribution
To install Apache Maven, extract the archive and add its bin directory to the PATH. This works on any operating system, but setting the path and environment variables depends on the OS.
Detailed steps are:
-
Download the Apache Maven binary distribution archive.
-
Extract the distribution archive in any directory. Use
unzip apache-maven-3.9.11-bin.ziportar xzvf apache-maven-3.9.11-bin.tar.gzdepending on the archive. -
Add the
bindirectory of the created directoryapache-maven-3.9.11to thePATHenvironment variable -
Confirm with
mvn -vin a new shell. The result should look similar to:
Apache Maven 3.9.11 (3e54c93a704957b63ee3494413a2b544fd3d825b) Maven home: /opt/apache-maven-3.9.11 Java version: 1.8.0_45, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.8.5", arch: "x86_64", family: "mac" That’s it! Maven is now installed.
macOS
Installation on macOS is supported by Homebrew, SDKMAN! and MacPorts.
Homebrew
brew install maven SDKMAN!
sdk install maven MacPorts
sudo port install maven3 Linux
The commands depend on the package manager of the Linux Distribution of your choice.
APT
sudo apt install maven DNF
sudo dnf install maven YUM
sudo yum install maven Windows
Installation on Windows is supported by Chocolatey and Scoop.
Chocolatey
choco install maven Scoop
scoop install main/maven 


