This is a list of mirrors to be used in downloading artifacts from remote repositories. It works like this: a POM may declare a repository to use in resolving certain artifacts.However, this repository may have problems with heavy traffic at times, so people have mirrored it to several places.
That repository definition will have a unique id, so we can create a mirror reference for that repository, to be used as an alternate download site. The mirror site will be the preferred server for that repository.
2、<mirrors> 中的 <mirror> 描述
Specifies a repository mirror site to use instead of a given repository. The repository that this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
3、镜像的默认配置
1 2 3 4 5 6 7
<mirror> <id>maven-default-http-blocker</id> <mirrorOf>external:http:*</mirrorOf> <name>Pseudo repository to mirror external repositories initially using HTTP.</name> <url>http://0.0.0.0/</url> <blocked>true</blocked> </mirror>