How to Install Maven on Mac OS
Installing Maven on MacOS
Go to https://maven.apache.org/download.cgi and search for the right version.
Download the tar file using command below
$ wget https://dlcdn.apache.org/maven/maven-3/3.9.0/binaries/apache-maven-3.9.0-bin.tar.gz
Untar the file and move the folder to Mac OS Java location
$ tar -xvf apache-maven-3.9.0-bin.tar.gz
Set environment variable to be able to use java from any location by adding the following to .bash_profile
$ vi $HOME/.bash_profile
M2_HOME="/Users/xxx/Downloads/apache-maven-3.9.0"
PATH="${M2_HOME}/bin:${PATH}"
export PATH
Restart the shell or source the bash_profile
Comments