1下载
wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
tar -zxf apache-maven-3.6.3-bin.tar.gz
mv apache-maven-3.6.3 maven3.6
2 配置环境变量
vim /etc/profile
加入如下内容:
#你的maven路径
export MAVEN_HOME=/home/maven3.6export PATH=${MAVEN_HOME}/bin:${PATH}
source /etc/profile
3 配阿里镜像
vim /home/maven3.6/conf/settings.xml
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
4 修改本地仓库
<localRepository>/home/MavenRepository</localRepository>