JCenter下载太慢?教你修改Maven仓库地址为国内镜像

解决方法一:

https:改成 http协议下载

下文介绍部分来源自:https://my.oschina.net/lifj/blog/754861

下面是build.gradle的内容:主要增加了jcenter(){url 'http://jcenter/bintray.com/'} 

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter(){ url 'http://jcenter.bintray.com/'}
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter(){url 'http://jcenter.bintray.com/'}
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

希望能帮到大家。

解决方法二:

改成开源中国maven镜像,这个方法没试过,不知道好不好用,需要的同学,可以自行测试

http://blog.csdn.net/biezhihua/article/details/49668605

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Maven 镜像仓库是用于存储和获取 Maven 项目所需的依赖项的地方。以下是一些好用的 Maven 镜像仓库地址: 1. Central Repository(中央仓库):https://repo.maven.apache.org/maven2/ Central Repository 是 Maven 默认的镜像仓库,包含了大量的开源 Java 项目和库。它是最权威和最全面的 Maven 镜像仓库之一。 2. Aliyun Maven(阿里云仓库):https://maven.aliyun.com/repository/ Aliyun Maven 是阿里云提供的稳定和高速的 Maven 镜像仓库。它提供了国内访问速度比较快的镜像地址,对于国内开发者来说非常方便。 3. JCenter(JFrog Bintray):https://jcenter.bintray.com/ JCenter 是一个广受欢迎的 Maven 镜像仓库,包含了大量的 Java 项目和库。它的稳定性和可靠性得到了开发者的认可。 4. Spring Repository(Spring仓库):https://repo.spring.io/release/ Spring Repository 是 Spring 官方提供的 Maven 镜像仓库,用于存储 Spring 相关的项目和库。对于使用 Spring 框架的开发者来说,Spring Repository 是一个重要的资源来源。 5. Maven 中国镜像:https://maven.aliyun.com/nexus/content/groups/public/ Maven 中国镜像是由阿里云维护的一个 Maven 镜像仓库,它包含了来自 Central Repository 的所有项目,同时提供了一些其他常用的第三方库。 以上列举的几个 Maven 镜像仓库都经过了广泛的使用和验证,拥有良好的稳定性和可靠性。根据个人的需求和网络环境,可以选择合适的镜像仓库加速 Maven 项目的构建和依赖下载
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值