maven给默认中央仓库设置镜像为阿里云maven仓库

maven3.5.4默认的中央仓库central地址是  http://repo.maven.apache.org/maven2/

但是网速一般,所以选择国内阿里云maven仓库

在settings.xml 中配置

    <mirror>
      <id>central</id>
      <mirrorOf>central</mirrorOf>
      <name>阿里云central库</name>
      <url>https://maven.aliyun.com/repository/central</url>
    </mirror>

<mirrorOf>是被拦截的仓库的id,被拦截的库将从镜像获取jar。这里我们拦截maven默认的中央库central。<mirrorOf>更高级的配置方式自己百度。

猜你喜欢

转载自blog.csdn.net/xiaoshizi4/article/details/83245729
今日推荐