You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ca...@apache.org on 2021/11/30 18:11:31 UTC

[kafka] branch 3.0 updated: HOTFIX: Set version of jgit to avoid unsupported version error (#11554)

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

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


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

commit ff862651a64d90d74d34094bb726b0a9962e9988
Author: Bruno Cadonna <ca...@apache.org>
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 <dj...@confluent.io>, Ismael Juma <is...@juma.me.uk>, Alexander Stohr, David Arthur <mu...@gmail.com>
---
 build.gradle               | 4 ++++
 gradle/dependencies.gradle | 1 +
 2 files changed, 5 insertions(+)

diff --git a/build.gradle b/build.gradle
index 7627dc1..17811e0 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 8d8b64e..d6360aa 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",