【问题标题】:Why can't I download artifact through Gradle?为什么我不能通过 Gradle 下载工件?
【发布时间】:2020-07-17 13:47:49
【问题描述】:

当 gradle 尝试通过 Gradle Central Plugin Repository 下载 org.springframework.boot', version: '2.1.9.RELEASE' 时做不到

FAILURE: Build failed with an exception.
 * Where:
 Build file '/usr/src/app/build.gradle' line: 2
 * What went wrong:
 Plugin [id: 'org.springframework.boot', version: '2.1.9.RELEASE'] was not found in any of the following sources:
 - Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
 - Plugin Repositories (could not resolve plugin artifact 'org.springframework.boot:org.springframework.boot.gradle.plugin:2.1.9.RELEASE')
   Searched in the following repositories:
     Gradle Central Plugin Repository

但是使用wget的时候可以拉出来

$ wget https://plugins.gradle.org/m2/org/springframework/boot/org.springframework.boot.gradle.plugin/2.1.9.RELEASE/org.springframework.boot.gradle.plugin-2.1.9.RELEASE.pom
 --2020-07-17 13:38:07--  https://plugins.gradle.org/m2/org/springframework/boot/org.springframework.boot.gradle.plugin/2.1.9.RELEASE/org.springframework.boot.gradle.plugin-2.1.9.RELEASE.pom
 Resolving plugins.gradle.org (plugins.gradle.org)... 104.18.190.9, 104.18.191.9, 2606:4700::6812:bf09, ...
 Connecting to plugins.gradle.org (plugins.gradle.org)|104.18.190.9|:443... connected.
 HTTP request sent, awaiting response... 200 OK

我也尝试使用我们的 nexus 代理,但没有帮助

pluginManagement {
    repositories {
        maven { url 'https://${NEXUS_LINK}/repository/GradlePluginPortal/' }
        mavenLocal()
    }
}

【问题讨论】:

    标签: spring spring-boot gradle


    【解决方案1】:

    在这方面我对 Gradle 有很多问题。

    两个指针:

    • 通过命令行运行./gradlew --debug,检查有关无法连接的任何错误 - gradle 不尊重其他地方的代理设置,您必须自己在 gradle.properties 中提供它们(如this
    • 尝试在 gradle.properties 中使用org.gradle.jvmargs=-Djavax.net.debug=ssl 以查看是否存在 SSL 问题 - 我遇到了“SunCertPathBuilderException:无法找到请求目标的有效证书路径”,使用任何命令行调试标志时未报告此问题。修复 seems to be a pain though

    【讨论】:

      猜你喜欢
      • 2014-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多