赞
踩
1.打开C:\apache-maven-3.8.6-bin\apache-maven-3.8.6\conf(默认解压位置)中的setting.xml文件
2.本地仓库是开发者本地电脑中的一个目录,用于缓存从远程仓库下载的构件。默认的本地仓库是${user.home}/.m2/repository。用户可使用settings.xml文件修改本地仓库。具体内容如下:
- <!-- 本地仓库配置 -->
- <localRepository>具体本地仓库位置</localRepository>
加入进去本地仓库就配置完成了
在国内直接连接中央仓库下载依赖,由于一些特殊原因下载速度非常慢。这时,我们可以使用阿里云提供的镜像http://maven.aliyun.com/nexus/content/groups/public/来替换中央仓库http://repol.maven.org/maven2/。修改maven的setting.xml文件,具体内容如下:
- 加入以下代码
-
-
- <mirror>
- <!-- 指定镜像ID(可自己改名) -->
- <id>nexus-aliyun</id>
- <!-- 匹配中央仓库(阿里云的仓库名称,不可以自己起名,必须这么写)-->
- <mirrorOf>central</mirrorOf>
- <!-- 指定镜像名称(可自己改名) -->
- <name>Nexus aliyun</name>
- <!-- 指定镜像路径(镜像地址) -->
- <url>http://maven.aliyun.com/nexus/content/groups/public</url>
- </mirror>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。