如果没有wget,则安装wget(可跳过)
yum -y install wget
打开目录
cd /usr/local
下载maven包
wget http://mirror.bit.edu.cn/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz
解压
tar zvxf apache-maven-3.6.0-bin.tar.gz
修改环境变量
vim /etc/profile
export MAVEN_HOME=/usr/local/apache-maven-3.6.0-bin.tar.gz
export MAVEN_HOME
export PATH=${PATH}:${MAVEN_HOME}/bin
刷新环境变量
source /etc/profile
验证
mvn -v