下载安装文件
cd /opt/software/
wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
解压安装
tar -zxf apache-maven-3.3.9-bin.tar.gz -C /opt/module/
cd /opt/module/
mv apache-maven-3.3.9 maven
配置环境变量
vim /etc/profile
# 新增以下内容
export M2_HOME=/opt/module/maven3
export PATH=${M2_HOME}/bin:$PATH
使配置文件生效