1.去maven官网下载maven
官网地址:https://maven.apache.org/download.cgi(注意下zip版)。
![](https://img-blog.csdnimg.cn/img_convert/56ef62e601f14fce9064a67d614538ee.png)
2.解压后修改conf目录下的settings.xml
1)注意解压路径放在英文路径下。
![](https://img-blog.csdnimg.cn/img_convert/67b6ec6e393141c6b2ac00619347dfd9.png)
2)注释掉原本默认仓库的位置,修改为自己本地的仓库(相当于自己创个文件夹放东西)。
![](https://img-blog.csdnimg.cn/img_convert/79885848cf68460cad25a835c6b930d2.png)
3)把默认的镜像注释,修改为阿里巴巴的镜像。
![](https://img-blog.csdnimg.cn/img_convert/cd6b5e4bde0342b487271c3729ffd9b1.png)
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
3.配置系统环境
1)新增MAVEN_HOME系统变量,注意配置到bin目录下。
![](https://img-blog.csdnimg.cn/img_convert/27acadf81bb04caf8ea2dfada6692dd8.png)
2)编辑Path系统变量,新建环境变量%MAVEN_HOME%。
![](https://img-blog.csdnimg.cn/img_convert/b9a2c911b9ed447c8db2deba2f148690.png)
3)打开cmd命令行输入mvn -v,出现以下界面说明maven配置成功。
![](https://img-blog.csdnimg.cn/img_convert/5a7170322846461abb07b39e91ab0623.png)
4.在idea中配置maven
点击File-->Settings中的maven,把路径配置为我们自己所下的maven,仓库会自动识别。
![](https://img-blog.csdnimg.cn/img_convert/d1c9d425d06f4025b29413685220acd2.png)