将maven仓库改为阿里仓库

为了证明我还活着,写一篇Maven换ali仓库

一 找文件

二 加点料

 1 <mirrors>
 2     <!-- mirror
 3      | Specifies a repository mirror site to use instead of a given repository. The repository that
 4      | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
 5      | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
 6      |
 7     <mirror>
 8       <id>mirrorId</id>
 9       <mirrorOf>repositoryId</mirrorOf>
10       <name>Human Readable Name for this Mirror.</name>
11       <url>http://my.repository.com/repo/path</url>
12     </mirror>
13      -->
14     
15       
16     <mirror>
17         <id>alimaven</id>
18         <mirrorOf>*</mirrorOf>
19         <name>aliyun maven</name>
20         <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
21     </mirror>
22 
23   
24   </mirrors>
View Code

三 重点在这里(添加的主要内容)

<mirror>
        <id>alimaven</id>
        <mirrorOf>*</mirrorOf>
        <name>aliyun maven</name>
        <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
 </mirror>

四 保存文件(ok)

五 更新索引

六  祝大家六六六

个人网站:http://www.tonyplot.xyz/

原文地址:https://www.cnblogs.com/money131/p/11139375.html