" />

飞道的博客

IDEA 解决maven下载很慢

332人阅读  评论(0)

(1)首先下载一个maven进行解压(已下载的忽略),然后找到对应的settings.xml文件

(2)将settings.xml文件中的内容全部替换为下面的内容


  
  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. | Specifies a repository mirror site to use instead of a given repository. The repository that
  8. | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
  9. | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
  10. |
  11. <mirror>
  12. <id>mirrorId</id>
  13. <mirrorOf>repositoryId</mirrorOf>
  14. <name>Human Readable Name for this Mirror.</name>
  15. <url>http://my.repository.com/repo/path</url>
  16. </mirror>
  17. -->
  18. <mirror>
  19. <id>alimaven </id>
  20. <name>aliyun maven </name>
  21. <url>http://maven.aliyun.com/nexus/content/groups/public/ </url>
  22. <mirrorOf>central </mirrorOf>
  23. </mirror>
  24. <mirror>
  25. <id>uk </id>
  26. <mirrorOf>central </mirrorOf>
  27. <name>Human Readable Name for this Mirror. </name>
  28. <url>http://uk.maven.org/maven2/ </url>
  29. </mirror>
  30. <mirror>
  31. <id>CN </id>
  32. <name>OSChina Central </name>
  33. <url>http://maven.oschina.net/content/groups/public/ </url>
  34. <mirrorOf>central </mirrorOf>
  35. </mirror>
  36. <mirror>
  37. <id>nexus </id>
  38. <name>internal nexus repository </name>
  39. <!-- <url>http://192.168.1.100:8081/nexus/content/groups/public/</url>-->
  40. <url>http://repo.maven.apache.org/maven2 </url>
  41. <mirrorOf>central </mirrorOf>
  42. </mirror>
  43. </mirrors>
  44. </settings>

 (3)打开IDEA,点击【File】-->【Settings】

(4) 找到对应Maven设置,并将箭头处的maven设置为刚刚解压的maven路径,最后勾上选择框,点击【OK】即可完成。

 (5)然后就能体验飞一般的下载速度了

 


转载:https://blog.csdn.net/sunnyzyq/article/details/104140022
查看评论
* 以上用户言论只代表其个人观点,不代表本网站的观点或立场