From e76af725a40cbebd3cf769f7e8932be35ca4079a Mon Sep 17 00:00:00 2001 From: Aditya M Date: Fri, 30 Oct 2026 12:50:23 -0700 Subject: [PATCH] Fix jreleaserDeploy JGit conflict and dry-run it in CI Spotless 8.x pulls JGit 7 onto the plugin classpath, while JReleaser 1.26.0 is built against JGit 5.13. jreleaserDeploy then fails with NoClassDefFoundError: org/eclipse/jgit/lib/GpgObjectSigner (removed in JGit 7), so a release cannot publish. Force JGit 5.13 on the buildscript classpath until JReleaser supports JGit 7; spotlessCheck passes with it. CI never ran jreleaserDeploy, so this went unnoticed. Add a step that runs publish + jreleaserDeploy --dryrun with a throwaway GPG key and dummy credentials on one matrix entry. --- .github/workflows/gradle.yml | 17 +++++++++++++++++ build.gradle | 10 ++++++++++ 2 files changed, 27 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index e9503ef04..bfb2b1fb6 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -58,6 +58,23 @@ jobs: run: | ./gradlew.bat build + - name: Run release deploy in dry-run mode + if: matrix.os == 'ubuntu-latest' && matrix.java-version == '25' + env: + GNUPGHOME: ${{ runner.temp }}/gnupg + JRELEASER_GPG_PUBLIC_KEY: ${{ runner.temp }}/public.asc + JRELEASER_GPG_SECRET_KEY: ${{ runner.temp }}/private.asc + JRELEASER_GPG_PASSPHRASE: dry-run + NEXUS_USERNAME: dry-run + NEXUS_PASSWORD: dry-run + run: | + # Throwaway signing key and dummy credentials; --dryrun skips all remote operations. + mkdir -m 700 "$GNUPGHOME" + gpg --batch --passphrase "$JRELEASER_GPG_PASSPHRASE" --quick-gen-key 'minio-java CI ' rsa3072 sign never + gpg --batch --armor --export > "$JRELEASER_GPG_PUBLIC_KEY" + gpg --batch --pinentry-mode loopback --passphrase "$JRELEASER_GPG_PASSPHRASE" --armor --export-secret-keys > "$JRELEASER_GPG_SECRET_KEY" + ./gradlew publishMinioJavaPublicationToPreDeployRepository jreleaserDeploy --dryrun -Prelease + - name: Setup java ${{ matrix.java-version }} for testing if: matrix.java-version != '25' uses: actions/setup-java@v6 diff --git a/build.gradle b/build.gradle index 937ea1364..458bf813a 100644 --- a/build.gradle +++ b/build.gradle @@ -18,6 +18,16 @@ /* gradleVersion = '9.8.2' */ /********************************/ +buildscript { + configurations.classpath { + // JReleaser 1.26.0 is built against JGit 5.13 and fails with NoClassDefFoundError + // org/eclipse/jgit/lib/GpgObjectSigner (removed in JGit 7) when Spotless 8.x pulls JGit 7 + // onto the shared plugin classpath. Spotless works with 5.13 for this build. Remove once + // JReleaser supports JGit 7. + resolutionStrategy.force 'org.eclipse.jgit:org.eclipse.jgit:5.13.5.202508271544-r' + } +} + plugins { id 'com.gradleup.shadow' version '9.6.1' id 'com.github.spotbugs' version '6.5.13'