maven添加阿里仓库

1、修改settings.xml

在maven的settings.xml 文件里配置mirrors的子节点,添加如下mirror

    <mirror>
        <id>nexus-aliyun</id>
        <mirrorOf>*</mirrorOf>
        <name>Nexus aliyun</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    </mirror> 

 2、pom.xml配置

在<project>节点下添加引用:

<repositories>  
    <repository>  
        <!-- Maven 自带的中央仓库使用的Id为central 如果其他的仓库声明也是用该Id  就会覆盖中央仓库的配置 --> 
        <id>nexus-aliyun</id>  
        <name>Nexus aliyun</name>  
        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  
        <layout>default</layout>  
        <releases>  
            <enabled>true</enabled>  
        </releases>  
        <snapshots>  
            <enabled>false</enabled>  
        </snapshots>  
    </repository>  
</repositories> 
原文地址:https://www.cnblogs.com/boshen-hzb/p/6590277.html