Maven setting Mirror

Maven setting Mirror

官网:

https://maven.apache.org/guides/mini/guide-mirror-settings.html

  • There is a synchronized mirror on the internet that is geographically closer and faster
  • You want to replace a particular repository with your own internal repository which you have greater control over
  • You want to run a repository manager to provide a local cache to a mirror and need to use its URL instead

使用场景:

可不通过修改工程pom的方式指定仓库,比如你的工程指定了仓库A,现在别人拿到你的工程但可能无法访问A仓库或想用自己的仓库B,此时在setting中将仓库A镜像到B,就会从B中找原来需要在A中找的依赖

通过标签指定你需要镜像的仓库ID,支持通配符*,使用时要注意,这样所有模块都会去同一个仓库找依赖

多次镜像同一仓库以第一次为准

你可能感兴趣的:(Maven)