How to do upgrade maven in Mac OS X?

How to do upgrade maven in Mac OS XMaven Build tool comes out-of-the-box (OOTB) with Mac OS X operating system. However developer reach the point to upgrade maven in Mac OS X. Article describes upgrade steps that is easy to use.

Default location of maven installation on Mac OS X is /usr/share/maven; well its actually symbolic link.  Following is the typical physical location of installed maven is under java directory  /usr/share/java/maven-x.x.x

Note: Article applies to 

  • OS X version 10.6 & above
  • Higher Maven versions (hopefully in future too)
  • Maven version denoted as x.x.x in the article
  • Feel free to leave a comment for any queries

Warm Up!

Let’s take a look at existing maven version

Just few more steps ahead to upgrade the required or latest version of maven in your machine.

Steps to do

Step 1

Download maven apache-maven-x.x.x-bin.tar.gz from Apache Maven website

Step 2

We are going to extract the downloaded maven tar into following physical directory /usr/share/java/maven-x.x.x as mentioned above

Step 3

Removing existing symbolic link using  unlink the existing maven reference from  /usr/share/

Step 4

We now reached the final part; creating a symbolic link on /usr/share to get your upgraded maven :)

Maven Upgrade is Complete

Now, just take a look of upgraded maven version

Wow, you did it! Successfully upgraded maven in your Mac OS X.

  • Jon_Indoors

    I had to change to the tar command to this:

    sudo tar -xvf apache-maven-3.0.5-bin.tar -C /usr/share/java

  • Torsten Becker

    Thanks for sharing. I downloaded everything and had to change the tar comment as above.

    I had to change the symbolic link to

    sudo ln -s /usr/share/java/apache-maven-3.0.5 /usr/share/maven

    to make it work.

    • Hello Torsten Becker – Thanks for notifying, I have corrected my typo mistakes :)


  • Colorado Kiwi

    Works perfectly, thanks for the share.

  • brew install maven

  • tuomas saarela

    Again, ln line is wrong because there’s a new version of Maven. Perhaps you could replace it with:

    sudo ln -s /usr/share/java/YOUR_NEW_MAVEN_DIR /usr/share/maven

    • Thanks for notifying, Just now I have updated the article with generic version notation as “x.x.x”