As of Mac OS X 10.5.5, Java is now up to 1.6 and Maven comes pre-installed at version 2.0.6. We’re going to upgrade Maven to the latest version 2.0.9. Check your versions!

Trinity:~ kelvin$ java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode)
Trinity:~ kelvin$ which mvn
Trinity:~ kelvin$ /usr/bin/mvn -v
Maven version: 2.0.6
Trinity:~ kelvin$ 
Trinity:~ kelvin$ 

Visit the Maven web site and download the latest version (currently 2.0.9). It downloads to the Download folder, so you will have to move it. I installed Maven to /usr/local/apache-maven

Trinity:~ kelvin$ sudo sh
sh-3.2# cd /usr/local
sh-3.2# wget
--2008-11-09 01:34:39--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2025041 (1.9M) [application/zip]
Saving to: `'

100%[======================================================================================>] 2,025,041    456K/s   in 5.1s    

2008-11-09 01:34:45 (389 KB/s) - `' saved [2025041/2025041]

sh-3.2# md5 
MD5 ( = 5e92d1c5b0a6580127059e28fe2f2b45
sh-3.2# unzip 
   creating: apache-maven-2.0.9/
   creating: apache-maven-2.0.9/conf/
  inflating: apache-maven-2.0.9/LICENSE.txt  
  inflating: apache-maven-2.0.9/NOTICE.txt  
  inflating: apache-maven-2.0.9/README.txt  
   creating: apache-maven-2.0.9/bin/
  inflating: apache-maven-2.0.9/bin/m2.bat  
  inflating: apache-maven-2.0.9/bin/m2.conf  
  inflating: apache-maven-2.0.9/bin/mvn.bat  
  inflating: apache-maven-2.0.9/bin/mvnDebug.bat  
  inflating: apache-maven-2.0.9/bin/m2  
  inflating: apache-maven-2.0.9/bin/mvn  
  inflating: apache-maven-2.0.9/bin/mvnDebug  
  inflating: apache-maven-2.0.9/conf/settings.xml  
   creating: apache-maven-2.0.9/lib/
  inflating: apache-maven-2.0.9/lib/maven-2.0.9-uber.jar  
   creating: apache-maven-2.0.9/boot/
  inflating: apache-maven-2.0.9/boot/classworlds-1.1.jar  
sh-3.2# exit
Trinity:~ kelvin$

The Maven installation instructions call for the creation of the M2 environment variables, so we need to do that. I put them into the .bash_profile file which is in your home directory.

export M2_HOME=/usr/local/apache-maven-2.0.9
export M2=$M2_HOME/bin
export PATH=$M2:$PATH

Put these somewhere near the top of your .bash_profile file so that the shell will find the mvn 2.0.9 version before it finds the old 2.0.6 version at /usr/bin/mvn.

Trinity:~ kelvin$ source .bash_profile
Trinity:~ kelvin$ mvn -v
Maven version: 2.0.9
Java version: 1.6.0_07
OS name: "mac os x" version: "10.5.5" arch: "x86_64" Family: "mac"
Trinity:~ kelvin$ echo $M2_HOME
Trinity:~ kelvin$ which mvn
Trinity:~ kelvin$