1)从网站上下载linux版本的maven安装包;
2)解压apache-maven-3.0.3-bin.tar.gz进行安装;
tar -xzvf apache-maven-3.0.3-bin.tar.gz
3)设置maven环境变量;
vim /etc/profile或者vim /etc/environment
#jesse add maven envirment
export M2_HOME=/opt/apache-maven
export M2=$M2_HOME/bin
export MAVEN_OPTS="-Xms256m -Xmx512m"
export PATH=$M2:$PATH
4)验证maven是否安装成功。
mvn -version
root@ciserver:/#mvn -version
Apache Maven 3.0.3(r1075438; 2011-02-28 17:31:09+0000)
Maven home:/opt/apache-maven
Java version:1.6.0_22, vendor: Sun Microsystems Inc.
Java home:/usr/lib/jvm/java-6-openjdk/jre
Default locale:zh_CN, platform encoding: GB2312
OS name:"linux", version: "2.6.38-8-server", arch: "amd64",family: "unix"
root@ciserver:/#
echo $M2
root@ciserver:/#echo $M2
/opt/apache-maven/bin