maven压缩包看文末,有提供网盘地址,或自行官网下载
maven依赖JDK,JDK安装参考上一篇
通过Xftp将压缩包上传到服务器,解压到指定的目录
[root@localhost package]# tar zxvf apache-maven-3.6.0-bin.tar.gz -C /usr/local/java
ps:Xftp上一篇也有提供网盘地址
配置环境变量
[root@localhost package]# vi /etc/profile
export MAVEN_HOME=/usr/local/java/apache-maven-3.6.0
export PATH=$PATH:$MAVEN_HOME/bin
使配置生效
[root@localhost package]# source /etc/profile
查看版本
[root@localhost package]# mvn -version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-25T02:41:47+08:00)
Maven home: /usr/local/java/apache-maven-3.6.0
Java version: 1.8.0_211, vendor: Oracle Corporation, runtime: /usr/local/java/jdk1.8.0_211/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: “linux”, version: “3.10.0-862.el7.x86_64”, arch: “amd64”, family: “unix”
提取码:3c03