4

I am searching the best way to install and configure maven on Mac OS please?

1

1 Answer 1

4

There are two methods:

With brew installation:

Without installing brew:

  • Download the Maven, for example apache-maven-3.1.1-bin.tar.gz. Extracts it, tar -xvf apache-maven-3.1.1-bin.tar.gz

  • Set Maven command in environment variable: Update ~/. bash_profile – create this file if doesn’t exist.

    ~/.bash_profile export M2_HOME=/Users/youusername/apache-maven-3.1.1 export PATH=$PATH:$M2_HOME/bin

  • Finally restart the terminal. Test it using: mvn -version

2
  • 1
    I strongly recommend to use the most recent Maven version which is 3.6.0 furthermore the M2_HOME variable is neither needed nor useful.
    – khmarbaise
    Feb 9, 2019 at 9:33
  • One other thought about. Best is to download Maven from the homepage and follow the instructions. For this is not needed to install Homebrew...
    – khmarbaise
    Feb 10, 2019 at 9:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.