去 Maven官网下载,然后解压即可
配置环境变量
MAVEN_HOME=bin所在目录
Path=%MAVEN_HOME%in;(注意是在Path中追加)
验证mvn是否配置成功 进入cmd 出现如下提示为配置成功
# mvn -v Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-05T03:00:29+08:00) Maven home: D:hecprojecthonglinghonglingToolapache-maven-3.6.1in.. Java version: 1.8.0_151, vendor: Oracle Corporation, runtime: C:Program FilesJavajdk1.8.0_151jre Default locale: zh_CN, platform encoding: GBK OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
修改配置文件
编辑 ~ conf/settings.xml
文件 (idea等使用此maven时 记得指定使用该配置文件)
<!-- Maven 本地仓库 -->
<localRepository>D:hechecToolapache-maven-3.6.1conf
epository</localRepository>
配置阿里镜像仓库
<mirrors>
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
</mirrors>