创建文件存放目录
创建文件夹 mkdir/usr/lcal/maven
创建后切换至该文件夹cd /usr/lcal/maven
下载安装包
maven 镜像地址 mirrors.tuna.tsinghua.edu.cn/apache/mave...

控制台输入指令:
wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-4/4.0.0-alpha-7/binaries/apache-maven-4.0.0-alpha-7-bin.zip

解压
查看下载文件ls

解压该文件unzip apache-maven-4.0.0-alpha-7-bin.zip

添加全局变量
编辑/etc/profile文件vim /etc/profile
添加maven环境依赖
ini
MAVEN_HOME=/usr/local/maven/apache-maven-4.0.0-alpha-7
export PATH=${MAVEN_HOME}/bin:${PATH}

使环境变量生效source /etc/profile

检验
查看版本信息mvn -v
