当前位置:   article > 正文

阿里云 gradle镜像库 解决原maven下载慢的问题_gradle maven阿里云好慢

gradle maven阿里云好慢

原maven经常下载慢,让人痛苦不堪,使用阿里云镜像体验飞一般的下载速度。找到项目根build.gradle,添加以下代码即可

  1. maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
  2. maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
  3. maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
  4. maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }

完整例子

  1. buildscript {
  2. repositories {
  3. maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
  4. maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
  5. maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
  6. maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
  7. jcenter()
  8. google()
  9. }
  10. dependencies {
  11. .......
  12. }
  13. }
  14. allprojects {
  15. repositories {
  16. maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
  17. maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
  18. maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
  19. maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
  20. jcenter()
  21. google()
  22. }
  23. }
  24. task clean(type: Delete) {
  25. delete rootProject.buildDir
  26. }
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/237431
推荐阅读
相关标签
  

闽ICP备14008679号