maven 百度百科
https://baike.baidu.com/item/Maven/6094909?fr=aladdin
maven可以在官网下载,或者在我的SSM总结找百度网盘链接,已经下载好的直接解压就可以安装;
https://maven.apache.org/download.cgi
maven的配置
指定本地仓库
<localRepository>D:\reposi</localRepository>
最好和我保持一致
添加镜像
<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>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
maven环境变量的配置
点击环境变量,先别点击确定~
然后找到path:添加 %M2_HOME%\bin
不同Windows版本,不同系统可能会有差异。我这里以Windows7 64位为例
最后验证:
cmd 输入 mvn -v
如果验证出现上图则显示成功!没有也很正常,看下图:
配置不成功,可以 删除 M2_HOME ,直接在path 后面追加 maven 的 bin 目录 路径。和JDK 配置一样!