IDEA 解决maven下载很慢

╰半橙微兮° 2023-07-03 04:38 105阅读 0赞

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

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3N1bm55enlx_size_16_color_FFFFFF_t_70

(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】

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3N1bm55enlx_size_16_color_FFFFFF_t_70 1

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

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3N1bm55enlx_size_16_color_FFFFFF_t_70 2

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

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3N1bm55enlx_size_16_color_FFFFFF_t_70 3

发表评论

表情:
评论列表 (有 0 条评论,105人围观)

还没有评论,来说两句吧...

相关阅读

    相关 maven下载解决

    现在maven项目非常流行,因为它对jar实行了一个非常方便的管理,我们可以通过在pom.xml文件中做对应的配置即可将所需要的jar包与自己的项目形成依赖。 但是通常我们会