Task 1: Installing Maven

Maven can be downloaded from http://maven.apache.org/download.html. Currently there are two major versions of Maven that are supported: 2.X and 3.X. In this book we'll be using 3.0.3.

Maven requires its main script mvn being in your execution path, an environment variable named M2_HOME that points to where you installed Maven and the environment variable JAVA_HOME which should point to your Java installation. Maven 2.2.1 requires Java 1.4 or higher and Maven 3.X requires Java ?.?.?. It is suggested you use Java 5 or 6.

Install Maven 3.0.3 on OS X

After downloading Maven 3.0.3 from http://maven.apache.org/download.html

tar -zxvf apache-maven-3.0.3.tar.gz
mv apache-maven-3.0.3 /Users/brian/Applications/

Then edit ~/.profile and add the following:

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
export M2_HOME=/Users/brian/Applications/apache-maven-3.0.3
export PATH=$PATH:$M2_HOME/bin

Once you're done editing you can run the following command to immediately execute your profile updates:

source ~/.profile

Install Maven 3.0.3 on Ubuntu

Manually installation of Maven on Ubuntu is similar to the Mac OS X process.

To install Maven using Ubuntu's package manager:

???apt-get install maven???

Install Maven 3.0.3 on Windows

TK