当前位置:   article > 正文

解决IDEA Maven 下载依赖包速度过慢问题_idea maven下载慢

idea maven下载慢

解决IDEA Maven 下载依赖包速度过慢问题 ,jar包下载过慢,有一部分网络原因,很大一部分是因为需要请求到国外镜像仓库,响应比较慢

右键点击项目,找到maven,选择 Open ‘settings.xml’或者Create ‘settings.xml’

将以下代码粘入文件中,重启idea即可提高速度

idea超级镜像库,这是阿里云镜像库和junit镜像库

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  5. <mirrors>
  6. <!-- <mirror>-->
  7. <!-- <id>mirrorId</id>-->
  8. <!-- <mirrorOf>repositoryId</mirrorOf>-->
  9. <!-- <name>Human Readable Name for this Mirror.</name>-->
  10. <!-- <url>http://my.repository.com/repo/path</url>-->
  11. <!-- </mirror>-->
  12. <mirror>
  13. <id>alimaven</id>
  14. <name>aliyun maven</name>
  15. <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
  16. <mirrorOf>central</mirrorOf>
  17. </mirror>
  18. <mirror>
  19. <id>uk</id>
  20. <mirrorOf>central</mirrorOf>
  21. <name>Human Readable Name for this Mirror.</name>
  22. <url>http://uk.maven.org/maven2/</url>
  23. </mirror>
  24. <mirror>
  25. <id>CN</id>
  26. <name>OSChina Central</name>
  27. <url>http://maven.oschina.net/content/groups/public/</url>
  28. <mirrorOf>central</mirrorOf>
  29. </mirror>
  30. <mirror>
  31. <id>nexus</id>
  32. <name>internal nexus repository</name>
  33. <url>http://repo.maven.apache.org/maven2</url>
  34. <mirrorOf>central</mirrorOf>
  35. </mirror>
  36. <!-- junit镜像地址 -->
  37. <mirror>
  38. <id>junit</id>
  39. <name>junit Address/</name>
  40. <url>http://jcenter.bintray.com/</url>
  41. <mirrorOf>central</mirrorOf>
  42. </mirror>
  43. <!-- <mirrors>-->
  44. <!-- mirror
  45. | Specifies a repository mirror site to use instead of a given repository. The repository that
  46. | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
  47. | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
  48. |
  49. <mirror>
  50. <id>mirrorId</id>
  51. <mirrorOf>repositoryId</mirrorOf>
  52. <name>Human Readable Name for this Mirror.</name>
  53. <url>http://my.repository.com/repo/path</url>
  54. </mirror>
  55. -->
  56. <mirror>
  57. <!--This sends everything else to /public -->
  58. <id>nexus-aliyun</id>
  59. <mirrorOf>*</mirrorOf>
  60. <name>Nexus aliyun</name>
  61. <url>http://maven.aliyun.com/nexus/content/groups/public</url>
  62. </mirror>
  63. <mirror>
  64. <id>osc</id>
  65. <mirrorOf>*</mirrorOf>
  66. <url>http://maven.oschina.net/content/groups/public/</url>
  67. </mirror>
  68. <mirror>
  69. <id>repo2</id>
  70. <mirrorOf>central</mirrorOf>
  71. <name>Human Readable Name for this Mirror.</name>
  72. <url>http://repo2.maven.org/maven2/</url>
  73. </mirror>
  74. <mirror>
  75. <id>net-cn</id>
  76. <mirrorOf>central</mirrorOf>
  77. <name>Human Readable Name for this Mirror.</name>
  78. <url>http://maven.net.cn/content/groups/public/</url>
  79. </mirror>
  80. <mirror>
  81. <id>ui</id>
  82. <mirrorOf>central</mirrorOf>
  83. <name>Human Readable Name for this Mirror.</name>
  84. <url>http://uk.maven.org/maven2/</url>
  85. </mirror>
  86. <mirror>
  87. <id>ibiblio</id>
  88. <mirrorOf>central</mirrorOf>
  89. <name>Human Readable Name for this Mirror.</name>
  90. <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
  91. </mirror>
  92. <mirror>
  93. <id>jboss-public-repository-group</id>
  94. <mirrorOf>central</mirrorOf>
  95. <name>JBoss Public Repository Group</name>
  96. <url>http://repository.jboss.org/nexus/content/groups/public</url>
  97. </mirror>
  98. <mirror>
  99. <id>JBossJBPM</id>
  100. <mirrorOf>central</mirrorOf>
  101. <name>JBossJBPM Repository</name>
  102. <url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
  103. </mirror>
  104. </mirrors>
  105. </settings>

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/237519
推荐阅读
相关标签
  

闽ICP备14008679号