访问 https://mirrors.tuna.tsinghua.edu.cn/apache/maven/ 查看支持的下来列表 本文选择maven-3
执行下载
wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
创建目标安装目录
mkdir -p /usr/local/maven3
解压并拷贝
cd apache-maven-3.6.3
cp -r * /usr/local/maven3/
配置环境变量
vim /etc/profile
最后加上
export PATH=$PATH:/usr/local/maven3/bin
别忘记执行 source /etc/profile 使修改生效 查看安装结构
[root@node2 bin]# mvn --version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/maven3
Java version: 14.0.1, vendor: Oracle Corporation, runtime: /usr/local/jdk14
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1127.19.1.el7.x86_64", arch: "amd64", family: "unix"
完成