Installing Maven 3

Installing maven 3 on linux platform involves few simple steps.

1. Download maven 3
You can download latest version from here or like

$sudo wget

Unpack the maven :

$sudo tar -xvfz apache-maven-3.0.4-bin.tar.gz

Copy extracted maven to your desired location :

$sudo cp -R apache-maven-3.0.4/ /usr/sw/

2. Adding PATH variables
Open the user profile in text editor

$sudo gedit /etc/profile

Add following lines in the file content

export M3=/usr/sw/apache-maven-3.0.4/bin
export M3_HOME=/usr/sw/apache-maven-3.0.4
export MAVEN_HOME=/usr/sw/apache-maven-3.0.4

And edit the variable PATH to this

export PATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/sw/apache-maven-3.0.4/bin”

Or you can add those path variables in “/etc/environment”

3. Testing maven
Logout from current user’s session and log back in. In terminal, execute command to check maven version

$mvn -version

The output message should look like this

Apache Maven 3.0.4 (r1232337; 2012-01-17 14:29:56+0545)
Maven home: /usr/sw/apache-maven-3.0.4
Java version: 1.6.0_23, vendor: Sun Microsystems Inc.
Java home: /usr/sw/jdk1.6.0_23/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-23-generic", arch: "i386", family: "unix"

Leave a comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.