Maven Installation Instructions

Download Maven library from the following URL At the time of writing this tutorial the latest version of Maven is 2.0.9. Download for Windows and apache-maven-2.0.9-bin.tar.gz from Linux platform.

2- Unzip the file at some proper location (in my case its C:\Program Files\Apache Software Foundation\apache-maven-2.0.9).

3- Make sure your JAVA_HOME environment variable is set to java home directory.

4- You need to setup two environment variables for Maven

a. M2_HOME

b. M2

For Windows:

Go to My Computer > Properties >Advance tab > Environment variables > Under User variables > New and provide both M2_HOME and M2 environment variables as shown in the following figures

See the figures below.

For Linux:

Go to your home directory > in the view menu, check "show hidden files". Open ".bashrc" file in an editor like gedit. At the end of the file add these three lines

export M2_HOME = Path_To_Maven_Home_Directory

export M2= Path_To_Maven_Bin_Directory

export PATH = $PATH: Path_To_Maven_Bin_Directory

5- You also need to update the PATH environment variable in order to access Maven commands from console. Go to My computer > properties > Advance tab > Click Environment Variable Button > under system variables find PATH variab

le > Click Edit and at the end provide the path up to the bin folder of Maven. In my case it is C:\Program Files\Apache Software Foundation\apache-maven-2.0.9\bin

6- To verify that every thing is setup according to the plan open console and type mvn --version. You should see something similar to the following figure.

See also: , Maven project home page, Download and detailed installation instructions., introduction to maven commands and building a web application in maven

0 comments for this post

Post a Comment

Blog Widget by LinkWithin