Builds suddenly failing because Gradle plugins are redirecting to Bintray

Within the past half an hour builds have stopped working in our JVM repos because Gradle plugins can’t be retrieved by CI – the reason being that plugins.gradle.org/m2/ is redirecting to jcenter.bintray.com, whose TLS certificate is no longer valid.

Here’s an example of a repo where this is happening: GitHub - relaycorp/awala-endpoint-android: High-level library for Android apps implementing Awala endpoints – Note that I haven’t changed anything recently. Here’s an example of a broken build, with the following output:

(...)
C:\Windows\system32\cmd.exe /D /S /C "D:\a\awala-endpoint-android\awala-endpoint-android\gradlew.bat build dokkaHtml --scan"

Welcome to Gradle 7.1.1!

Here are the highlights of this release:
 - Faster incremental Java compilation
 - Easier source set configuration in the Kotlin DSL

For more details see https://docs.gradle.org/7.1.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'awaladroid'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.32.
     Required by:
         project : > com.android.tools.build:gradle:7.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools:sdk-common:30.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools:repository:30.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools.build:aaptcompiler:7.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools.analytics-library:shared:30.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools.lint:lint-model:30.0.3
         project : > com.android.tools.build:gradle:7.0.3 > androidx.databinding:databinding-compiler-common:7.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools.utp:android-test-plugin-host-retention-proto:30.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools.build:builder:7.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools.build:builder-model:7.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools.build:gradle-api:7.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools:sdk-common:30.0.3 > com.android.tools:common:30.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools.build:builder:7.0.3 > com.android.tools.analytics-library:tracker:30.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools.build:builder:7.0.3 > com.android.tools.build:manifest-merger:30.0.3
      > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.32.
         > Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.4.32/kotlin-stdlib-jdk8-1.4.32.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.4.32/kotlin-stdlib-jdk8-1.4.32.pom'.
               > PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
   > Could not resolve org.apache.httpcomponents:httpmime:4.5.6.
     Required by:
         project : > com.android.tools.build:gradle:7.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools:sdklib:30.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools.analytics-library:crash:30.0.3
      > Could not resolve org.apache.httpcomponents:httpmime:4.5.6.
         > Could not get resource 'https://plugins.gradle.org/m2/org/apache/httpcomponents/httpmime/4.5.6/httpmime-4.5.6.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/apache/httpcomponents/httpmime/4.5.6/httpmime-4.5.6.pom'.
               > PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
   > Could not resolve commons-io:commons-io:2.4.
     Required by:
         project : > com.android.tools.build:gradle:7.0.3
         project : > com.android.tools.build:gradle:7.0.3 > androidx.databinding:databinding-compiler-common:7.0.3
      > Could not resolve commons-io:commons-io:2.4.
         > Could not get resource 'https://plugins.gradle.org/m2/commons-io/commons-io/2.4/commons-io-2.4.pom'.
            > Could not GET 'https://jcenter.bintray.com/commons-io/commons-io/2.4/commons-io-2.4.pom'.
               > PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
   > Could not resolve org.ow2.asm:asm:7.0.
     Required by:
         project : > com.android.tools.build:gradle:7.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools.build:builder:7.0.3
         project : > com.android.tools.build:gradle:7.0.3 > com.android.tools.build:gradle-api:7.0.3
      > Could not resolve org.ow2.asm:asm:7.0.
         > Could not get resource 'https://plugins.gradle.org/m2/org/ow2/asm/asm/7.0/asm-7.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/ow2/asm/asm/7.0/asm-7.0.pom'.
               > PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
   > Could not resolve org.ow2.asm:asm-analysis:7.0.
     Required by:
         project : > com.android.tools.build:gradle:7.0.3
      > Could not resolve org.ow2.asm:asm-analysis:7.0.
         > Could not get resource 'https://plugins.gradle.org/m2/org/ow2/asm/asm-analysis/7.0/asm-analysis-7.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/ow2/asm/asm-analysis/7.0/asm-analysis-7.0.pom'.
               > PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
(...)
8 Likes

I can confirm this issue.

1 Like

I’m having the same problem:

Could not resolve all artifacts for configuration ':classpath'.
  > Could not resolve org.sonarsource.scanner.api:sonar-scanner-api:2.14.0.2002.
    Required by:
  project : > org.sonarqube:org.sonarqube.gradle.plugin:2.8 > org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8
     > Could not resolve org.sonarsource.scanner.api:sonar-scanner-api:2.14.0.2002.
         > Could not get resource 'https://plugins.gradle.org/m2/org/sonarsource/scanner/api/sonar-scanner-api/2.14.0.2002/sonar-scanner-api-2.14.0.2002.pom'.
         > Could not HEAD 'https://plugins.gradle.org/m2/org/sonarsource/scanner/api/sonar-scanner-api/2.14.0.2002/sonar-scanner-api-2.14.0.2002.pom'.
             > sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed

Confirm the issue.
jcenter’s certificate expired 1h ago.

Additionally, the was an announcement that jcenter shouldn’t be used: JCenter shutdown impact on Gradle builds

This is a plugins issue. In that same article you linked, it says:

We will be migrating the Plugin Portal away from JCenter before the final shutdown

but the TLS cert issue has beat that to the punch

Behind the scenes, the Gradle Plugin Portal uses JCenter to resolve dependencies of plugins. We will be migrating the Plugin Portal away from JCenter before the final shutdown. Builds will not need to make changes while the Plugin Portal migrates away from JCenter.

I’m having the same problem too.

I already removed jCenter() repository but the official gradlePluginPortal() is causing all the mess. :frowning:

It seems they just renewed the cert.

4 Likes