如果你的mac笔记本安装了homebrew可以使用如下命令安装
brew install maven
安装完成后可以使用命令brew list maven来查看maven的安装位置
$ brew list maven
/usr/local/Cellar/maven/3.6.3_1/bin/mvn
/usr/local/Cellar/maven/3.6.3_1/bin/mvnDebug
/usr/local/Cellar/maven/3.6.3_1/bin/mvnyjp
/usr/local/Cellar/maven/3.6.3_1/libexec/bin/ (4 files)
/usr/local/Cellar/maven/3.6.3_1/libexec/boot/ (2 files)
/usr/local/Cellar/maven/3.6.3_1/libexec/conf/ (3 files)
/usr/local/Cellar/maven/3.6.3_1/libexec/lib/ (70 files)
需要注意的是/usr/local/Cellar/maven/3.6.3_1/libexec/conf/这个目录,这个目录下面存放了maven的配置文件
众所周知,maven的中央仓库服务器在国外,国内的下载速度很慢,如果想修改成国内的镜像仓库,可以修改/usr/local/Cellar/maven/3.6.3_1/libexec/conf/目录下的配置文件settings.xml
打开这个配置文件,找到mirrors节点,在mirrors节点下面添加子节点:
nexus-aliyun
central
Nexus aliyun
http://maven.aliyun.com/nexus/content/groups/public
修改完成之后,如下图所示

然后保存文件就可以了!