zoukankan      html  css  js  c++  java
  • Gradle项目无法下载jar包 修改 插件下载地址plugins.gradle.org

    报错信息

    * What went wrong:
    A problem occurred configuring root project 'MyApp'.
    > Could not resolve all files for configuration ':classpath'.
       > Could not download jimfs.jar (com.google.jimfs:jimfs:1.1)
          > Could not get resource 'https://plugins.gradle.org/m2/com/google/jimfs/jimfs/1.1/jimfs-1.1.jar'.
             > Could not HEAD 'https://plugins.gradle.org/m2/com/google/jimfs/jimfs/1.1/jimfs-1.1.jar'.
                > Connect to d29vzk4ow07wi7.cloudfront.net:443 [d29vzk4ow07wi7.cloudfront.net/54.192.84.6, d29vzk4ow07wi7.cloudfront.net/54.192.84.168, d29vzk4ow07wi7.cloudfront.net/54.192.84.128, d29vzk4ow07wi7.cloudfront.net/54.192.84.173] failed: Read timed out

    修改配置

    Gradle的默认仓库:

    修改默认仓库为其他可用镜像。

    在根目录的settings.gradle中添加pluginManagement节点注意:必须放置在rootProject.name属性前。

    pluginManagement {
        repositories {
            maven {
                url 'http://examle.com/maven-repo'
            }
            gradlePluginPortal()
        }
    }
    
    rootProject.name = 'test-project-name'

    这个时候再运行 gradle --debug 地址已经变了,但是代理好像还没生效

    Performing HTTP GET: https://maven.aliyun.com/repository/gradle-plugin/org/springframework/boot/org.springframework.boot.gradle.plugin/2.4.2/org.springframework.boot.gradle.plugin-2.4.2.pom


  • 相关阅读:
    centos7配置java环境
    docker下安装vim
    小程序开发知识点总结
    response设置输出文件编码
    IDEA中,将文件夹加入classpath
    【问题排查】StringIndexOutOfBoundsException
    【问题排查记录】Field 'id' doesn't have a default value;
    http
    raw_input() 与 input() __ Python
    记一次eclipse无法启动的排查过程
  • 原文地址:https://www.cnblogs.com/cnchengv/p/14339903.html
Copyright © 2011-2022 走看看