在使用springboot的时候一个starter下载好几十分钟,下载有时候还会连接超时,推荐一个镜像库(类似中央仓库,下载依赖从镜像库的url下载),阿里镜像库。
打开apache-maven\conf\settings.xml,设置标签
<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> `` ```java刷新重新加载依赖 可以看到aliyun就代表成功了