欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Maven专题 settings.xml文件 配置阿里云镜像,以及pom中修改仓库

程序员文章站 2022-06-05 18:38:42
...
  1. 在本地maven目录下,找到conf文件夹下的settings.xml 文件
  2. 找到 <mirrors> 标签
  3. 在mirrors标签中添加阿里云镜像后如下
<mirrors>
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
</mirrors>

pom.xml 中也可以如下修改(可以不修改)

<repositories>  
        <repository>  
            <id>alimaven</id>  
            <name>aliyun maven</name>  
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  
            <releases>  
                <enabled>true</enabled>  
            </releases>  
            <snapshots>  
                <enabled>false</enabled>  
            </snapshots>  
        </repository>  
</repositories>
相关标签: maven maven