Maven 是一个基于 Java 的工具,所以首先需要安装 JDK。
Maven 下载地址:http://maven.apache.org/download.cgi
本文使用maven版本:3.8.7
1. 解压maven
apache-maven-3.8.7-bin.tar.gz 链接:https://pan.baidu.com/s/1F-AXa_aHPma86EPyVhTqpQ 提取码:fq0u
将apache-maven-3.8.7-bin.tar.gz上传至服务器/opt/upload目录,解压后,移动到/usr/local目录
[root@ZWZF-CWY-LZY-12 upload]# tar -zxvf apache-maven-3.8.7-bin.tar.gz [root@ZWZF-CWY-LZY-12 upload]# mv apache-maven-3.8.7 /usr/local
2. 配置maven环境变量
[root@ZWZF-CWY-LZY-12 local]# vim /etc/profile export MAVEN_HOME=/usr/local/apache-maven-3.8.7 export PATH=${PATH}:${MAVEN_HOME}/bin [root@ZWZF-CWY-LZY-12 local]# source /etc/profile
3. 查看maven版本
[root@ZWZF-CWY-LZY-12 local]# mvn -v Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29) Maven home: /usr/local/apache-maven-3.8.7 Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: /opt/jdk1.8.0_191/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.10.0-957.el7.x86_64", arch: "amd64", family: "unix"
标签:CWY,LZY,安装,配置,maven,apache,local,3.8 From: https://www.cnblogs.com/silgen/p/17024737.html