Install Apache Maven in Mac OS X Leopard


Install Lift 2.1 in MacOSX Leopard > (3) Install Maven in MacOSX Leopard:

As we said before, Lift project uses Apache Maven as its default build system, luckily Maven is already installed on the Mac OS X Leopard computers, and we can check the version using the following command:

mvn --version

It is will appear the following message:

Apache Maven 2.2.0 (r788681; 2009-06-26 15:04:01+0200)
Java version: 1.6.0_20
Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.6.4" arch: "x86_64" Family: "mac"

If you don’t already have Maven or in case it does not have the version you are looking for, then, the first thing to do is to download and install it on your Mac OS X Leopard. The process of installing Maven typically involves four simple steps, which are as follows:

1) To download a release build archive appropriate for your platform, in this case MacOS X from http://maven.apache.org/download.html. You may want to get the zip file on a Windows machine and tarred zip or bz2 file on a Linux, Unix or Mac OSX machine.

2) Expand the archive file in a preferred folder within your file system.

3) Create or update a few environment variables, namely:

JAVA_HOME – point it to your JDK folder. I assume JDK is already installed. If not, go get it before you go further.
M2_HOME – point it to the folder where Maven is installed. It’s the same that was created when you extracted the Maven archive.
M2 – point it to %M2_HOME%\bin on windows and $M2_HOME/bin on Linux/Unix/Mac OSX
PATH – update the PATH environment variable. Add M2 to it.
MAVEN_OPTS – Add -Xms256m -Xmx512m to this environment variable.