maven 仓库优先级

优先级:

本地仓库 >profile > pom中的repository > mirror

setting.xml中<mirrorOf>*</mirrorOf>这样配置镜像 会导致maven忽略其他仓库  只从这个仓库中查找

发现如果在<mirrorOf>中配置*,表示当前mirror为所有仓库镜像,所有远程仓库请求地址为当前mirror对应的URL( having it mirror all repository requests)。所以我把此处的mirrorOf改为resp1,此时当前mirror只会拦截仓库resp1的依赖请求,对于其他请求会到远程*仓库去下载,但下载的速度非常的慢,同时出现连接超时的现象:

maven 仓库优先级