1、下载
下载界面:https://maven.apache.org/download.cgi
2、上传到服务器,自定义安装位置为/usr/local/maven
$ tar -xvzf apache-maven-3.3.9-bin.tar.gz
$ mkdir /usr/local/maven
$ mv apache-maven-3.3.9 /usr/local/maven
3、配置环境变量
export PATH=/usr/local/ruby/bin:$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin
export MAVEN_HOME=/jk/app/maven/apache-maven-3.6.1
4、验证 mvn -v