maven 之更换阿里云仓库

1.先找到maven安装目录下的 /conf

比如我的目录是 F:/apache-maven-3.6.1/conf

2.设置setting.xml文件

将下面的代码放入< mirrors >中

<mirror>
     <id>aliyunmavenid>
     <mirrorOf>*mirrorOf>
     <name>阿里云公共仓库name>
     <url>https://maven.aliyun.com/repository/publicurl>
    mirror>
     <mirror>
     <id>aliyunmavenid>
     <mirrorOf>*mirrorOf>
     <name>阿里云谷歌仓库name>
     <url>https://maven.aliyun.com/repository/googleurl>
    mirror>
    <mirror>
     <id>aliyunmavenid>
     <mirrorOf>*mirrorOf>
     <name>阿里云阿帕奇仓库name>
     <url>https://maven.aliyun.com/repository/apache-snapshotsurl>
    mirror>
    <mirror>
     <id>aliyunmavenid>
     <mirrorOf>*mirrorOf>
     <name>阿里云spring仓库name>
     <url>https://maven.aliyun.com/repository/springurl>
    mirror>
    <mirror>
     <id>aliyunmavenid>
     <mirrorOf>*mirrorOf>
     <name>阿里云spring插件仓库name>
     <url>https://maven.aliyun.com/repository/spring-pluginurl>
    mirror>

替换完成后,maven库改成了阿里云库。

你可能感兴趣的:(问题解决)