当前位置:   article > 正文

mac系统下,在eclipse里配置maven的国内镜像_mac eclipse maven配置镜像

mac eclipse maven配置镜像

1. 点击前往档案夹

输入/users/<user name>/.m2

回车

进入到该目录下,创建settings.xml,默认是没有该文件的,eclipse的maven工具安装时不会新建该文件

而该文件上方的repository文件夹是用来存放通过maven下载的插件的,如下图

2. 打开eclipse偏好设置

进入maven-user settings,点击user setting的browse按钮

选择新建的settings.xml文件

user setting右边就会出现open file按钮

点击open file按钮就会在eclipse里面打开settings.xml文件

3. 在打开的文件里输入

  1. <settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  2. <mirrors>
  3. <!-- mirror | Specifies a repository mirror site to use instead of a given
  4. repository. The repository that | this mirror serves has an ID that matches
  5. the mirrorOf element of this mirror. IDs are used | for inheritance and direct
  6. lookup purposes, and must be unique across the set of mirrors. | -->
  7. <mirror>
  8. <id>nexus-aliyun</id>
  9. <mirrorOf>central</mirrorOf>
  10. <name>Nexus aliyun</name>
  11. <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
  12. </mirror>
  13. <mirror>
  14. <id>nexus-aliyun-thirdparty</id>
  15. <mirrorOf>thirdparty</mirrorOf>
  16. <name>Nexus aliyun thirdparty</name>
  17. <url>http://maven.aliyun.com/nexus/content/repositories/thirdparty/</url>
  18. </mirror>
  19. </mirrors>
  20. <profiles>
  21. <profile>
  22. <id>default</id>
  23. <repositories>
  24. <repository>
  25. <id>nexus</id>
  26. <name>local private nexus</name>
  27. <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
  28. <releases>
  29. <enabled>true</enabled>
  30. </releases>
  31. <snapshots>
  32. <enabled>false</enabled>
  33. </snapshots>
  34. </repository>
  35. </repositories>
  36. <pluginRepositories>
  37. <pluginRepository>
  38. <id>nexus</id>
  39. <name>local private nexus</name>
  40. <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
  41. <releases>
  42. <enabled>true</enabled>
  43. </releases>
  44. <snapshots>
  45. <enabled>false</enabled>
  46. </snapshots>
  47. </pluginRepository>
  48. </pluginRepositories>
  49. </profile>
  50. </profiles>
  51. </settings>

参考:

https://yq.aliyun.com/articles/6861

把参考文章里的链接换成aliyun的,开源中国的用不了了

用文章里的写法不会报无法读取settings.xml错误

而且经过试验,下载好插件后,pom.xml也不会报错,下载速度也比较快

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

闽ICP备14008679号