-
Notifications
You must be signed in to change notification settings - Fork 17
Installing Maven
rajivkanaujia edited this page Dec 20, 2020
·
1 revision
$ brew update
$ brew install maven
The response will be similar to
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
nushell
==> Downloading https://www.apache.org/dyn/closer.lua?path=maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin
==> Downloading from https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
######################################################################## 100.0%
🍺 /usr/local/Cellar/maven/3.6.3_1: 87 files, 10.7MB, built in 7 seconds
$ which mvn
/usr/local/bin/mvn
Note the location of "Maven home"
$ mvn -v
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
Java version: 14.0.1, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.4", arch: "x86_64", family: "Mac"
export M2_HOME=/usr/local/Cellar/maven/3.6.3_1/libexec
export M2=${M2_HOME}/bin
export PATH=${PATH}:${M2_HOME}/bin
[ -d $M2_HOME ] && echo " Directory $M2_HOME exists." || echo " Error: Directory $M2_HOME does not exists."
Note: If you like the instructions here, please refer it on your posts/documentation. Contact me if there are corrections needed.