zoukankan      html  css  js  c++  java
  • 解决网速慢时maven仓库访问慢

    构建maven项目时会下载很多依赖,会从官网地址下载是个外国网站,访问速度会很慢,但可以通过修改maven的settings.xml文件换成国内的镜像地址就可以加快访问速度:

    一、找到settings.xml

    (1)我的放在C:Userszrk.m2下

    (2)idea里依次点File->Settings,在弹出框搜索maven,可以查看或配置路径

    (3)eclipse下可以参考:

    https://www.cnblogs.com/flying607/p/6223148.html

    二、修改配置

    打开settings.xml,搜索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.
            |
    
            -->
        </mirrors>

    在mirrors中添加一个<mirror>,保存即可

    <mirror>
          <id>mirrorId</id>
          <mirrorOf>central</mirrorOf>
          <name>Human Readable Name for this Mirror.</name>
          <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    </mirror>

    最终效果:

  • 相关阅读:
    bzoj3796
    bzoj2186
    bzoj3769
    bzoj2660
    bzoj2245
    bzoj2916
    bzoj1261
    在IDEA中以TDD的方式对String类和Arrays类进行学习
    2018-2019-2 实验二《Java面向对象程序设计》实验报告
    《Java程序设计》第 6 周学习总结
  • 原文地址:https://www.cnblogs.com/zrk3/p/maven_speed_up.html
Copyright © 2011-2022 走看看