n0mer / gradle-git-properties

Gradle plugin for `git.properties` file generation
https://plugins.gradle.org/plugin/com.gorylenko.gradle-git-properties
Apache License 2.0
323 stars 55 forks source link

jCenter certificate expired November 9th and now my projects no longer build #191

Closed matsandreassen closed 3 years ago

matsandreassen commented 3 years ago

The title says it all. Here's the error:

Could not resolve all artifacts for configuration ':classpath'. Could not resolve org.eclipse.jgit:org.eclipse.jgit:latest.release. Required by: project : > com.gorylenko.gradle-git-properties:com.gorylenko.gradle-git-properties.gradle.plugin:2.3.1 > com.gorylenko.gradle-git-properties:gradle-git-properties:2.3.1 > org.ajoberstar.grgit:grgit-core:4.1.0 Failed to list versions for org.eclipse.jgit:org.eclipse.jgit. Unable to load Maven meta-data from https://plugins.gradle.org/m2/org/eclipse/jgit/org.eclipse.jgit/maven-metadata.xml. Could not HEAD 'https://jcenter.bintray.com/org/eclipse/jgit/org.eclipse.jgit/maven-metadata.xml'. PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed

EDIT: I've added a pull request in an attempt to be helpful: https://github.com/n0mer/gradle-git-properties/pull/192

fmonorchio commented 3 years ago

Same problem here!

legart commented 3 years ago

You should remove jcenter from your builds, it has been shutdown

https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/

fmonorchio commented 3 years ago

I do not have jcenter. only mavenCentral.

legart commented 3 years ago

Have you seen https://github.com/n0mer/gradle-git-properties/issues/180 ?

matsandreassen commented 3 years ago

You should remove jcenter from your builds, it has been shutdown

https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/

It's a transitive dependency through this plugin so the problem is not in my project.

The README instructions on how to replace jgit version worked but I'd rather somebody published a 2.3.2 of this plugin with updated jgit.

With regards to #180: JFrog decided that jCenter is to live on in read-only mode, but the certificate expired today.

fmonorchio commented 3 years ago

I'm using

buildscript {
    repositories {
        gradlePluginPortal()
    }
dependencies {
        classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.3.1"
    }
}

What I need to change?

matsandreassen commented 3 years ago

I'm using

buildscript {
    repositories {
        gradlePluginPortal()
    }
dependencies {
        classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.3.1"
    }
}

What I need to change?

Check the README. It has instructions on what to add. Replace your dependency line with:

classpath ("com.gorylenko.gradle-git-properties:gradle-git-properties:2.3.1") {
            exclude group: "org.eclipse.jgit", module: 'org.eclipse.jgit' // remove plugin's jgit dependency
}
classpath "org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r" // use the specified jgit dependency
gabrielcardetti commented 3 years ago

I'm using

buildscript {
    repositories {
        gradlePluginPortal()
    }
dependencies {
        classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.3.1"
    }
}

What I need to change?

Check the README. It has instructions on what to add. Replace your dependency line with:

classpath ("com.gorylenko.gradle-git-properties:gradle-git-properties:2.3.1") {
            exclude group: "org.eclipse.jgit", module: 'org.eclipse.jgit' // remove plugin's jgit dependency
}
classpath "org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r" // use the specified jgit dependency

This worked for me

tha2015 commented 3 years ago

Can you help to check if it works by just changing from "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.3.1" to "com.gorylenko.gradle-git-properties:gradle-git-properties:2.3.1" ? I suspect that updating jgit version has no impact to the result.

gabrielcardetti commented 3 years ago

I tried that first but it didn't work

tha2015 commented 3 years ago

I'm trying to understand the root cause. This is my build.gradle file

buildscript {
    repositories {
        gradlePluginPortal()
    }
    dependencies {
        classpath ("com.gorylenko.gradle-git-properties:gradle-git-properties:2.3.1")
    }
}
apply plugin: 'java'
apply plugin: "com.gorylenko.gradle-git-properties"

And it works fine. Any sample/suggestion to reproduce the issue? Thanks

matsandreassen commented 3 years ago

Well, JFrog fixed the problem. They've update their certificate which you can see if you visit https://jcenter.bintray.com/org/eclipse/jgit/org.eclipse.jgit/maven-metadata.xml

Now this works again:

plugins {
    id "com.gorylenko.gradle-git-properties" version "2.3.1"
}
matsandreassen commented 3 years ago

I'm trying to understand the root cause. This is my build.gradle file

buildscript {
    repositories {
        gradlePluginPortal()
    }
    dependencies {
        classpath ("com.gorylenko.gradle-git-properties:gradle-git-properties:2.3.1")
    }
}
apply plugin: 'java'
apply plugin: "com.gorylenko.gradle-git-properties"

And it works fine. Any sample/suggestion to reproduce the issue? Thanks

I closed the issue since the problem went away with their certificate fix, but maybe my solution should be applied anyway to remove this dependency on jCenter.

tha2015 commented 3 years ago

I'm not aware about jCenter dependency by the plugin (directly or indirectly). I'd like to understand why we are having these issues before we applying the fix.