Friday, May 8, 2015

Install latest maven from apache

Since Ubuntu's repository comes with rather old version of maven, we need to install this from binary download from apache web site.

Here, we install latest version of 3.2.x which is 3.2.5 at the moment.
(linux diredory layout http://www.nixtutor.com/linux/understanding-the-linux-directory-layout/ )

Download from http://maven.apache.org/download.cgi

Install to /usr/lib/apache/maven/3.2.5

sudo mkdir -p /usr/lib/apache/maven/3.2.5

cd /usr/lib/apache/maven/3.2.5

sudo tar xvf ~/Downloads/apache-maven-3.2.5-bin.tar.gz

sudo mv apache-maven-3.2.5/* .

sudo rmdir apache-maven-3.2.5


Then we need to set environment variables.

add /usr/lib/apache/maven/3.2.5/bin to PATH

export MAVEN_HOME=/usr/lib/apache/maven/3.2.5



If we set environment variables in .bashrc, we will need to source the .bashrc file.

. ~/.bashrc

Check with :

mvn -ver

No comments:

Post a Comment