Issue
I have maven3.1.1 and maven3.2.5 installed on my mac.
When I do mvn -version it shows maven3.1.1
How can I switch to the other maven version 3.2.5 ?
Solution
Your Current bash profile would be pointing to the maven version 3.1.1 as shown below
~/.bash_profile
export M2_HOME=/Users/yourusername/apache-maven-3.1.1 (Path where you have installed maven 3.1.1)
export PATH=$PATH:$M2_HOME/bin
Change the bash profile as shown below
~/.bash_profile
export M2_HOME=/Users/yourusername/apache-maven-3.2.5 (Maven 3.2.5 path)
export PATH=$PATH:$M2_HOME/bin
Restart the terminal and hit command mvn -version
and now it will be pointing to the latest version.
Answered By - Clement Amarnath
Answer Checked By - David Goodson (JavaFixing Volunteer)