Wednesday, April 22, 2015

Setting Maven on Amazon Ubuntu Linux


Download the compressed maven binary. 

$ sudo wget ftp://apache.mirrors.pair.com/maven/maven-3/3.3.1/binaries/apache-maven-3.3.1-bin.tar.gz

If the link is old, get the latest link from maven site. Copy the link address, by selecting a proper mirror site.
Once you have proper link, the above command will download the compressed file.

$ ls
apache-maven-3.3.1-bin.tar.gz

$ sudo tar -xzvf apache-maven*

$sudo mv apache-maven-3.3.1 /usr/local/maven

$vi ~/.bashrc

type Esc , then i

Go to last line
add 
export M2_HOME=/usr/local/maven
export MAVEN_HOME=/usr/local/maven
export M2=/usr/local/maven/bin
export PATH=${PATH}:$M2

then type following commands :

Esc
:wq!

This will exit the vi editor

$source ~/.bashrc  
$mvn -version

You are all set. You will see following logs
Apache Maven 3.3.1
Maven home: /usr/local/maven

No comments:

Post a Comment