1.下载maven
下载路径:
https://dlcdn.apache.org/maven/maven-3/3.8.4/binaries/apache-maven-3.8.4-bin.zip
2.解压拷贝
unzip apache-maven-3.8.4-bin.zip
mv apache-maven-3.8.4 /usr/local/
3.添加到环境变量
vi /etc/profile
添加下面内容到文件尾部
export MAVEN_HOME=/usr/local/apache-maven-3.8.4
export PATH=$MAVEN_HOME/bin:$PATH
执行
source /etc/profile
4.验证
执行
mvn -version