环境介绍
操作系统:CentOS Linux release 7.8.2003 (Core)
安装
1、安装wget命令
yum -y install wget
2、下载maven安装包
wget --no-check-certificate https://mirrors.cnnic.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz
注意:
通过wget方式下载maven安装包时,出现以下错误时,在wget后面加上--no-check-certificate
ERROR: cannot verify mirrors.cnnic.cn's certificate, issued by ‘/C=GB/ST=Greater Manchester/L=Salford/O=Sectigo Limited/CN=Sectigo RSA Domain Validation Secure Server CA’:
Issued certificate has expired.
To connect to mirrors.cnnic.cn insecurely, use `--no-check-certificate'.
3、解压maven安装包
tar -xvf apache-maven-3.6.3-bin.tar.gz
4、配置maven
vi /etc/profile
export MAVEN_HOME=/usr/local/maven
export PATH=$MAVEN_HOME/bin:$PATH
5、环境变量生效
source /etc/profile
6、检查maven环境是否安装成功