软件下载
wget http://mirror.bit.edu.cn/apache/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz
安装
tar vxf apache-maven-3.6.1-bin.tar.gz
mv apache-maven-3.6.1 /usr/local/maven3
修改环境变量
[root@localhost ~]# vi /etc/profile
在/etc/profile中添加以下几行
MAVEN_HOME=/usr/local/maven3
export MAVEN_HOME
export PATH=${PATH}:${MAVEN_HOME}/bin
[root@localhost ~]# source /etc/profile
记得执行source /etc/profile使环境变量生效。
查看是否安装成功
[root@localhost ~]# mvn -version
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04- 05T03:00:29+08:00)
Maven home: /usr/local/maven3