This is an automated email from the ASF dual-hosted git repository.

cadonna pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/3.1 by this push:
     new e15cedf  HOTFIX: Set version of jgit to avoid unsupported version 
error (#11554)
e15cedf is described below

commit e15cedffccf0b0e2131fb6998c22129934d1b21f
Author: Bruno Cadonna <[email protected]>
AuthorDate: Tue Nov 30 18:42:41 2021 +0100

    HOTFIX: Set version of jgit to avoid unsupported version error (#11554)
    
    A new version of JGit that is used by grgit that is used by gradle
    causes the following error:
    
    org/eclipse/jgit/storage/file/FileRepositoryBuilder 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
    
    The reason is that version 6.0.0.202111291000-r of JGrit was compiled
    with a newer Java version than Java 8, probably Java 11.
    
    Explicitly setting the version of JGrit in gradle to 5.12.0.202106070339-r 
fixes
    the issue.
    
    Reviewers: David Jacot <[email protected]>, Ismael Juma 
<[email protected]>, Alexander Stohr, David Arthur <[email protected]>
---
 build.gradle               | 4 ++++
 gradle/dependencies.gradle | 1 +
 2 files changed, 5 insertions(+)

diff --git a/build.gradle b/build.gradle
index b79cec2..9680e9d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -26,6 +26,10 @@ buildscript {
   dependencies {
     // For Apache Rat plugin to ignore non-Git files
     classpath "org.ajoberstar.grgit:grgit-core:$versions.grgit"
+    // Override jgit dependency used by grgit and spotless as we appear to 
auto resolve to 
+    // 5.13.0.202109080827-r and the latest version requires java 9.
+    // Requires force=true to be used in spotless as reported by ./gradlew 
buildEnvironment.
+    classpath("org.eclipse.jgit:org.eclipse.jgit:$versions.jgit") { force = 
true }
   }
 }
 
diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle
index 050b2d2..ce5d371 100644
--- a/gradle/dependencies.gradle
+++ b/gradle/dependencies.gradle
@@ -71,6 +71,7 @@ versions += [
   javassist: "3.27.0-GA",
   jetty: "9.4.43.v20210629",
   jersey: "2.34",
+  jgit: "5.12.0.202106070339-r",
   jline: "3.12.1",
   jmh: "1.32",
   hamcrest: "2.2",

Reply via email to