Linux(Centos7.6)安装maven3.6
- 下载文件:http://maven.apache.org/download.cgi
将文件放到/opt文件夹下面, 若没有上传命令先执行:
1
yum -y install lrzsz
解压到当前文件夹
1
tar zxvf maven*.tar.gz
添加阿里云镜像
1
2
3
4
5
6
7
8
9vim /opt/maven/config/settings.xml
```
```xml
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>配置环境变量
1
2
3
4vim /etc/profile
export MAVEN_HOME=/opt/apache-maven-3.6.3
export PATH=$MAVEN_HOME/bin:$PATH
source /etc/profile校验是否安装成功
1
mvn -v\-version