安装maven3.3.9:
1.在/usr/local文件中创建:
[root@localhost local]# mkdir maven
2.上传下载好的maven文件到创建的文件中;
3.解压 apache-maven-3.3.9-bin.tar.gz 文件:
[root@localhost maven]# tar -zxvf apache-maven-3.3.9-bin.tar.gz
4.设置maven的环境变量:
[root@localhost maven]# vi /etc/profile
5.在profile的文件末尾加上以下配置:
export M2_HOME=/usr/local/maven/apache-maven-3.3.9export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$M2_HOME/bin:$PATH
6.执行source命令让新配置的profile生效:
[root@localhost maven]# source /etc/profile
7.测试maven是否安装成功
[root@localhost maven]# mvn -vApache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:47-05:00)Maven home: /usr/local/maven/apache-maven-3.3.9Java version: 1.8.0_121, vendor: Oracle CorporationJava home: /usr/local/java/jdk1.8.0_121/jreDefault locale: en_US, platform encoding: UTF-8OS name: "linux", version: "3.10.0-514.el7.x86_64", arch: "amd64", family: "unix"