Installing Maven on Mac OS

  1. Download Maven binary archive (apache-maven-3.6.1-bin.tar.gz)

2. Go to your Downloads/ in terminal and extract the contents of the archive:

➜ Downloads tar xfz apache-maven-3.6.1-bin.tar

3. Move the extracted content to any folder, eg Applications:

mv Downloads/apache-maven* /Applications/apache-maven-3.6.1

4. Next, setup maven classpath to your environment variable by updating .bash_profile file:

➜ ~ open ~/.bash_profile
export M2_HOME=/Applications/apache-maven-3.6.1
export PATH=$PATH:$M2_HOME/bin
➜ ~ source ~/.bash_profile

5. Now you have successfully added Maven, and you can check its version like this:

mvn -v

Everything is unknown until it’s known. Self-learner.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store