1.下载地址 maven
2.解压配置环境变量
vim ~/.zshrc
export M2_HOME=/Users/xxxx/xxxx/apache-maven-3.6.3
export PATH=$PATH:$M2_HOME/bin
3.使环境变量生效
source ~/.zshrc
4. 验证安装
mvn -v
5.编辑 M2_HOME/conf/setting.xml
文件找到<mirrors>
节点,往里面添加配置代码(阿里云)
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>