欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  Java

用maven下载jar包非常慢该怎么解决?

程序员文章站 2022-04-18 18:49:26
...
maven是支持镜像的,我们可以在maven的conf文件加下的setting.xml文件中找到<mirrors></mirrors>标签

<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>my.repository.com/repo/path</url>

</mirror>

-->

</mirrors>


在这个标签中加入国内的镜像即可,在这里推荐阿里云的镜像,下载速度有明显的加快

<mirror>

<id>alimaven</id>

<mirrorOf>central</mirrorOf>

<name>aliyun maven</name>

<url>maven.aliyun.com/nexus/content/repositories/central/</url>

</mirror>

以上就是用maven下载jar包非常慢该怎么解决?的详细内容,更多请关注其它相关文章!