当前位置:   article > 正文

阿里云代理仓库地址

阿里云代理仓库地址

在天朝使用jcenter、mavenCentral及google三个远程仓库,Gradle Sync会很慢,google仓库甚至需要科学上网才能访问。为了加快Gradle Sync速度,一招教你优先用 阿里云仓库服务 的仓库作为下载源。

一劳永逸之道
将本项目的gradle/init.d/init.gradle复制到USER_HOME/.gradle/下即可。
USER_HOME在Windows上大约为C:/Users/liyujiang/.gradle/,在Linux上大约为/home/liyujiang/.gradle/。
init.d/init.gradle内容为:

  1. /*
  2. *
  3. * The software is licensed under the Mulan PSL v2.
  4. * You can use this software according to the terms and conditions of the Mulan PSL v2.
  5. * You may obtain a copy of Mulan PSL v2 at:
  6. * http://license.coscl.org.cn/MulanPSL2
  7. * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
  8. * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
  9. * PURPOSE.
  10. * See the Mulan PSL v2 for more details.
  11. */
  12. buildscript {
  13. repositories {
  14. maven { url 'https://maven.aliyun.com/repositories/jcenter' }
  15. maven { url 'https://maven.aliyun.com/repositories/google' }
  16. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  17. }
  18. }
  19. allprojects {
  20. repositories {
  21. maven { url 'https://repo.eclipse.org/content/repositories/paho-releases/' }
  22. maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
  23. maven { url 'https://maven.aliyun.com/repositories/jcenter' }
  24. maven { url 'https://maven.aliyun.com/repositories/google' }
  25. maven { url 'https://maven.aliyun.com/repository/central' }
  26. maven { url "https://www.jitpack.io" }
  27. }
  28. }

文章出自:

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/288008
推荐阅读
相关标签
  

闽ICP备14008679号