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.

Install Lift 2.1 in MacOSX Leopard (II) – Install the Scala Language

2) Install the Scala Language:

I open the finder and choose the option Go to Folder select /usr/local/, then we rename the folder to Scala and we copied the folder there.We could also move it by Terminal using the following command:

$ sudo mv ~/Downloads/scala-2.8.0.final /usr/local
$ sudo mv ~/Downloads/scala /usr/local

if we have already changed its file name.We edit the local PATH file. We open the Terminal application, we edit the .profile file (we can use vim editor or the TextEdit, or directly use Textmate if we have it installed using the mate ~/.profile).

open -a TextEdit .profile
SCALA_HOME=/usr/local/scala;
export $SCALA_HOME; export SCALA="$SCALA_HOME/bin/scala"
PATH=$SCALA_HOME/bin:$PATH; export PATH
source ~/.profile

To test it we can insert the following command on the Terminal application

scala -version

And the following sentence will appear:

Scala code runner version 2.8.0.final -- Copyright 2002-2010, LAMP/EPFL