Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.3.1 stopped working with Java 8 #195

Closed
gotson opened this issue Nov 30, 2021 · 13 comments · Fixed by #196
Closed

Version 2.3.1 stopped working with Java 8 #195

gotson opened this issue Nov 30, 2021 · 13 comments · Fixed by #196

Comments

@gotson
Copy link

gotson commented Nov 30, 2021

Suddenly my project throws this exception when running with Java 8. It works fine with Java 11.

FAILURE: Build failed with an exception.

* Where:
Build file 'build.gradle.kts' line: 4

* What went wrong:
An exception occurred applying plugin request [id: 'com.gorylenko.gradle-git-properties', version: '2.3.1']
> Failed to apply plugin 'com.gorylenko.gradle-git-properties'.
   > Could not create an instance of type com.gorylenko.GitPropertiesPluginExtension.
      > org/eclipse/jgit/api/errors/JGitInternalException has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Version 2.3.1 has not been updated recently, so i'm not sure what's going on.

@KENNYSOFT
Copy link
Contributor

ajoberstar/grgit#339

@gotson
Copy link
Author

gotson commented Nov 30, 2021

Here is a workaround to force the transitive version of JGit used by the plugin:

Kotlin Script

buildscript {
  dependencies {
    "classpath"("org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r") {
      isForce = true
    }
  }
}

Groovy

buildscript {
  dependencies {
    classpath 'org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r' {
      force = true
    }
  }
}

@huangjunbiao
Copy link

huangjunbiao commented Nov 30, 2021

I have the same problem.I found a new version:2.4.0-rc1 in https://plugins.gradle.org/. It seems to be working but i am not sure the 2.4.0-rc1 Version is available.

@croqueGrec09
Copy link

croqueGrec09 commented Nov 30, 2021

I have the same issue with version 2.2.4.

@douph1
Copy link

douph1 commented Nov 30, 2021

with old gradle 6.8.3 replace
isForce = true
with
force = true
for the workaround from @gotson
Thanks you @gotson

@gotson
Copy link
Author

gotson commented Nov 30, 2021

with old gradle 6.8.3 replace isForce = true with force = true for the workaround from @gotson Thanks you @gotson

isForce is for Kotlin Script, force is for Groovy. See https://docs.gradle.org/current/userguide/dependency_downgrade_and_exclude.html#forced_dependencies_vs_strict_dependencies for more details

@gotson
Copy link
Author

gotson commented Nov 30, 2021

I have updated my snippet above to provide both Kotlin Script and Groovy.

@kazukikawaguchi1108
Copy link

it also works like this
※with gradle 6.7.1

configurations.all {
    resolutionStrategy.force "org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r"
}
dependencies {
    classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.2.4"
}

thanks you @gotson

@dcebotarenco
Copy link

with Gradle 5

configurations.all {
resolutionStrategy.force "org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r"
}
dependencies {
classpath 'com.gorylenko.gradle-git-properties:gradle-git-properties:2.3.1'
}

snopoke added a commit to dimagi/formplayer that referenced this issue Nov 30, 2021
@paulosousadias
Copy link

paulosousadias commented Nov 30, 2021

with Gradle 7.3

buildscript {
    dependencies {
        classpath ('org.eclipse.jgit:org.eclipse.jgit:') {
            version {
                strictly '5.13.0.202109080827-r'
            }
        }
    }
}

paulosousadias added a commit to LSTS/neptus that referenced this issue Nov 30, 2021
… with 99bc85d and gradle plugin gradle-git-properties).

Not sure when, but just started giving error on the CI.
See n0mer/gradle-git-properties#195.
KENNYSOFT added a commit to KENNYSOFT/gradle-git-properties that referenced this issue Dec 1, 2021
mernst added a commit to mernst/checker-framework that referenced this issue Dec 2, 2021
mernst added a commit to typetools/checker-framework that referenced this issue Dec 2, 2021
tha2015 added a commit that referenced this issue Dec 2, 2021
Update grgit-core to 4.1.1 (Fix #195)
tha2015 pushed a commit that referenced this issue Dec 2, 2021
(cherry picked from commit a68ebda)
@tha2015
Copy link
Collaborator

tha2015 commented Dec 2, 2021

Version 2.3.2 (based on 2.3.1 tag) has been published with the fix from @KENNYSOFT
https://plugins.gradle.org/plugin/com.gorylenko.gradle-git-properties/2.3.2

@tha2015 tha2015 reopened this Dec 2, 2021
@tha2015
Copy link
Collaborator

tha2015 commented Dec 2, 2021

Version 2.4.0-rc2 (based on master) has been published with the fix from @KENNYSOFT
https://plugins.gradle.org/plugin/com.gorylenko.gradle-git-properties

@tha2015
Copy link
Collaborator

tha2015 commented Feb 7, 2022

Hi @KENNYSOFT ,
Version 2.4.0 has been released with this fix. Thanks a lot!
-Thai

cexbrayat added a commit to Ninja-Squad/data-discovery that referenced this issue Mar 10, 2022
Bastian added a commit to Bastian/Javacord that referenced this issue Apr 25, 2022
The old version was not compatible with Java 8.
See n0mer/gradle-git-properties#195
cexbrayat added a commit to Ninja-Squad/data-discovery that referenced this issue Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants