当前位置:   article > 正文

IDEA设置Maven 镜像_idea配置maven镜像

idea配置maven镜像

 第一步:右键项目,选择Maven->Create ‘settings.xml’(已经存在的话是Open ‘settings.xml’)



第二步:在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. <id>central</id>
  8. <url>https://repo1.maven.org/maven2/</url>
  9. <mirrorOf>central</mirrorOf>
  10. </mirror>
  11. <mirror>
  12. <id>netease</id>
  13. <url>http://maven.netease.com/repository/public/</url>
  14. <mirrorOf>central</mirrorOf>
  15. </mirror>
  16. <mirror>
  17. <id>huaweicloud</id>
  18. <url>https://repo.huaweicloud.com/repository/maven/</url>
  19. <mirrorOf>central</mirrorOf>
  20. </mirror>
  21. <mirror>
  22. <id>tencent</id>
  23. <url>https://mirrors.cloud.tencent.com/repository/maven/</url>
  24. <mirrorOf>central</mirrorOf>
  25. </mirror>
  26. <mirror>
  27. <id>ustc</id>
  28. <url>http://mirrors.ustc.edu.cn/maven/maven2/</url>
  29. <mirrorOf>central</mirrorOf>
  30. </mirror>
  31. <mirror>
  32. <id>nju</id>
  33. <url>http://maven.nju.edu.cn/repository/</url>
  34. <mirrorOf>central</mirrorOf>
  35. </mirror>
  36. <mirror>
  37. <id>tsinghua</id>
  38. <url>https://repo.maven.apache.org/maven2/</url>
  39. <mirrorOf>central</mirrorOf>
  40. </mirror>
  41. <mirror>
  42. <id>bit</id>
  43. <url>http://mirror.bit.edu.cn/maven/</url>
  44. <mirrorOf>central</mirrorOf>
  45. </mirror>
  46. <mirror>
  47. <id>neusoft</id>
  48. <url>https://mirrors.neusoft.edu.cn/maven2/</url>
  49. <mirrorOf>central</mirrorOf>
  50. </mirror>
  51. <mirror>
  52. <id>opencas</id>
  53. <url>http://maven.opencas.cn/maven/</url>
  54. <mirrorOf>central</mirrorOf>
  55. </mirror>
  56. <mirror>
  57. <id>bjtu</id>
  58. <url>http://maven.bjtu.edu.cn/maven2/</url>
  59. <mirrorOf>central</mirrorOf>
  60. </mirror>
  61. <mirror>
  62. <id>aliyun</id>
  63. <url>http://maven.aliyun.com/</url>
  64. <mirrorOf>central</mirrorOf>
  65. </mirror>
  66. </mirrors>
  67. </settings>

第三步:在pom.xml文件上右击,选择Maven->Reimport(或者是Reload project )

注意:

  1. maven的全局配置默认路径是C:\Users[当前用户].m2\settings.xml,本人默认路径是C:\Users\user\.m2\settings.xml。
  2. maven的配置路径可以在settings中的maven中修改
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/一键难忘520/article/detail/880809
推荐阅读
相关标签
  

闽ICP备14008679号