1.下载apache-maven-3.1.0-bin.tar.gz
mkdir maven
chmod 755 /maven
2.解压 tar -zxvf apache-maven-3.1.0-bin.tar.gz
3 .设置全局变量 vim /etc/profile
M2_HOME=/opt/maven/apache-maven-3.2.1
export M2_HOME
PATH=$PATH:$M2_HOME/bin
export PATH
执行source /etc/profile
4. 测试 mvn -v 显示
Apache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-28 10:15:32+0800)
Maven home: /home/fuyuanming/maven
Java version: 1.7.0_91, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-573.8.1.el6.i686", arch: "i386", family: "unix"
出现上面的提示则表示安装成功