首页 > 代码库 > maven 仓库下载缓慢,怎么解决

maven 仓库下载缓慢,怎么解决

  maven下载jar的时候会去寻国外的地址,因此造成了下载jar很缓慢,影响开发效率;可以配置maven的镜像服务器,具体配置方式:

在maven的setting.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>nexus-aliyun</id>
        <mirrorOf>*</mirrorOf>
        <name>Nexus aliyun</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    </mirror>
    
     
  </mirrors>

 Maven 管理 jar 包的依赖关系.各类jar包及版本可以在 Maven Central仓库 中找到. 也可以访问  mvnrepository:org.springframework.

 

maven 仓库下载缓慢,怎么解决