速度很快的 Maven 远程仓库(阿里云 nexus 仓库)

我们可以在 .m2 下的 settings.xml 文件中配置镜像:

<mirrors>
    <mirror>
        <id>alimaven</id>
        <name>aliyun maven</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        <mirrorOf>central</mirrorOf>       
    </mirror>
</mirrors>

如图:



 
如果你的构建工具是 Gradle,那么可以在 build.gradle 文件的第 1 行写上:

allprojects {
    repositories {
        maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
    }
}

猜你喜欢

转载自121088825.iteye.com/blog/2337515