Install Maven 3 on Ubuntu 11.04

Install Maven 3 on Ubuntu 11.04

 

1. Download Maven 3 latest version

 

$ cd /home/<myusername>
$ wget http://labs.mop.com/apache-mirror/maven/binaries/apache-maven-3.0.4-bin.tar.gz
tar -zxvf apache-maven-3.0.4-bin.tar.gz

 

2. Unpacks maven to  a more appropriate directory, most people like to use  / usr/local/apache-maven-3.0.4

 

$ tar -xzvf apache-maven-3.0.4-bin.tar.gz -C /usr/local/

 

Add the Maven PATH variables to the environment file. Follwoing two lines are included to user .bashrc file located in my home directory, like /home/user1/.bashrc

 

MAVEN_HOME=/usr/local/apache-maven-3.0.4
export PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH

 

Recompile .bashrc by:

 

$ source .bashrc

 

To test the successful installation run the Maven version checker:

 

$ mvn -version

 

It returns something like:

 

Apache Maven 3.0.4 (r1232337; 2012-01-17 16:44:56+0800)
Maven home: /usr/local/apache-maven-3.0.4
Java version: 1.6.0_26, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-6-sun-1.6.0.26/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "2.6.38-11-server", arch: "amd64", family: "unix"

 

 

 

On RHEL5.5 redhat linux

wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh ./epel-release-5-4.noarch.rpm
yum install git

wget http://labs.mop.com/apache-mirror/maven/binaries/apache-maven-3.0.4-bin.tar.gz
tar -zxvf apache-maven-3.0.4-bin.tar.gz

你可能感兴趣的:(maven,linux,ubuntu)