1. 下载maven安装包
https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz
2. 上传到服务器,解压
sudo tar -zxvf apache-maven-3.9.6-bin.tar.gz
3. 配置环境变量
export M2_HOME=/java/apache-maven-3.9.6/
PATH=$M2_HOME/bin:$PATH
source /etc/profile
4.验证
echo $M2_HOME
echo $PATH
mvn -v