maven 配置阿里云中央仓库

一、修改maven根目录下的conf文件夹中的setting.xml文件

1 <mirror>
2       <id>alimaven</id>
3       <name>aliyun maven</name>
4       <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
5       <mirrorOf>central</mirrorOf>        
6 </mirror>

二、在maven项目工程中的pom.xml里直接加入

<repositories>
        <repository>
            <id>maven-ali</id>
            <url>http://maven.aliyun.com/nexus/content/groups/public//</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>fail</checksumPolicy>
            </snapshots>
        </repository>
    </repositories>
原文地址:https://www.cnblogs.com/zhangweibin/p/10036953.html