OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.97k stars 6.59k forks source link

[BUG] Could not build new project due to jCenter shutdown #10816

Open maksimkurb opened 3 years ago

maksimkurb commented 3 years ago

Bug Report Checklist

Description

The certificate of jCenter is outdated as per 2021-11-09. This leads to building error:

A problem occurred configuring project ':project-name'.
> Could not resolve all artifacts for configuration ':project-name:classpath'.
   > Could not resolve org.openapitools:openapi-generator:5.3.0.
     Required by:
         project :project-name > org.openapi.generator:org.openapi.generator.gradle.plugin:5.3.0 > org.openapitools:openapi-generator-gradle-plugin:5.3.0
      > Could not resolve org.openapitools:openapi-generator:5.3.0.
         > Could not get resource 'https://plugins.gradle.org/m2/org/openapitools/openapi-generator/5.3.0/openapi-generator-5.3.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/openapitools/openapi-generator/5.3.0/openapi-generator-5.3.0.pom'.
               > PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.30.
     Required by:
         project :project-name > org.openapi.generator:org.openapi.generator.gradle.plugin:5.3.0 > org.openapitools:openapi-generator-gradle-plugin:5.3.0
      > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.30.
         > Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.30/kotlin-stdlib-jdk8-1.3.30.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.30/kotlin-stdlib-jdk8-1.3.30.pom'.
               > PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org

org.openapitools:openapi-generator-gradle-plugin:5.3.0 should be published to another repo, perhaps Maven Central, you can follow JCenter shutdown impact on Gradle builds article for more info.

openapi-generator version

5.3.0

OpenAPI declaration file content or url

not applicable

Generation Details
Steps to reproduce
  1. Clean all gradle caches
  2. Build a minimal repo with gradle plugin id 'org.openapi.generator' version '5.3.0'
Related issues/PRs

Related issue in Kotlin gradle plugin: https://youtrack.jetbrains.com/issue/KT-49621

Suggest a fix

Publish org.openapitools:openapi-generator-gradle-plugin to Maven Central instead of jCenter

Temporary fix

I've found a temporary fix, you can add this snippet at the very top of your settings.gradle file:

pluginManagement {
    repositories {
        mavenCentral()
        gradlePluginPortal()
    }
}
makarova commented 3 years ago

+1

maksimkurb commented 3 years ago

The problem was fixed by JFrog, they have updated their certs.

trevorschadt commented 2 years ago

The issue has resurfaced, and with JCenter looking to go permanently offline there needs to be a better solution than assuming they will update their certs.

Relevant build output

> Could not resolve com.fasterxml.jackson.datatype:jackson-datatype-joda:2.12.5.
     Required by:
         project : > org.openapitools:openapi-generator-gradle-plugin:5.3.1 > org.openapitools:openapi-generator:5.3.1 > com.fasterxml.jackson.datatype:jackson-datatype-guava:2.12.5 > com.fasterxml.jackson:jackson-bom:2.12.5
      > Could not resolve com.fasterxml.jackson.datatype:jackson-datatype-joda:2.12.5.
         > Could not get resource 'https://plugins.gradle.org/m2/com/fasterxml/jackson/datatype/jackson-datatype-joda/2.12.5/jackson-datatype-joda-2.12.5.module'.
            > Could not GET 'https://jcenter.bintray.com/com/fasterxml/jackson/datatype/jackson-datatype-joda/2.12.5/jackson-datatype-joda-2.12.5.module'. Received status code 502 from server: Bad Gateway

Suggest a fix: Remove all references to jcenter repository in openapi-generator build files

SilverSheep commented 2 years ago

+1

wing328 commented 2 years ago

Thanks for informing us about this. I wonder if you guys have time to file a PR to update the mustache templates to remove any reference to jcenter?