1.下载安装包 https://archive.apache.org/dist/maven/maven-3/
2.将apache-maven-3.3.9-bin.zip解压到指定目录
3.配置系统环境变量
变量名:MAVEN_HOME
变量值:D:\Softwares\Maven\apache-maven-3.3.9
在PATH中添加:%MAVEN_HOME%\bin
4.测试是否安装成功
mvn -version
5.修改本地仓库地址,找到conf\settings.xml或者.m2\settings.xml配置文件
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<localRepository>D:/Softwares/Maven/repository</localRepository>
6.配置阿里源
<mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>