Skip to content

ci: pin JDK 17 in the publish job - #119

Merged
tanderson-ld merged 1 commit into
mainfrom
tanderson/publish-jdk-pin
Nov 3, 2026
Merged

tanderson-ld merged 1 commit into
mainfrom
tanderson/publish-jdk-pin

Conversation

@tanderson-ld

@tanderson-ld tanderson-ld commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Why

The 6.0.0 release failed at the Sonatype publish step (failed run):

Could not open settings generic class cache for settings file '.../settings.gradle'
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 69

The build-and-publish job never sets up a JDK, so ./gradlew runs on the runner image's default Java. The ubuntu-latest image default recently moved to Java 25 (class file major 69), which Gradle 7.6.3 cannot run on (it supports JVM ≤ 19). The CI matrix legs in this same workflow are unaffected because the shared CI action pins temurin 8/11/17 — the publish job was the only Gradle invocation relying on the image default. The 6.0.0 tag and GitHub release were created, but the artifact never reached Maven Central, and the javadoc publish was skipped.

What

Adds actions/setup-java (temurin 17) to build-and-publish, covering both the Sonatype publish and the ./gradlew javadoc step in the same job. This matches how the publish paths in java-core and android-client-sdk get their JDK (the shared CI composite with actions/setup-java@v4 + temurin; android publishes with 17). Java 17 is the highest LTS in this repo's CI matrix and is what prior releases effectively built with, back when the image default was 17.

The commit is ci: typed so release-please does not propose a 6.0.1 — 6.0.0 itself still needs to go out.

Recovery after merge

Manually dispatch Publish Package on main with run_tests=true, dry_run=false, prerelease=false. gradle.properties on main already reads 6.0.0, so that publishes the existing release. (Re-running the failed release run would not pick up this fix — re-runs pin workflow files to the original commit.)

A Gradle upgrade was considered and deferred: running on Java 25 requires Gradle 9.1.0, which exceeds the max Gradle supported by the Kotlin plugin this build relies on for the okhttp-jvm POM mapping — and the publish toolchain should stay pinned regardless of Gradle version.


Note

Overview
Fixes failed Maven Central publishes when build-and-publish runs Gradle on ubuntu-latest’s default JDK (Java 25), which Gradle 7.6.3 cannot use.

The workflow now runs actions/setup-java with Temurin 17 right after checkout in that job, so Sonatype publish and ./gradlew javadoc use a supported JVM—aligned with the repo’s CI matrix and other LaunchDarkly Java publish flows that already pin a JDK.

Reviewed by Cursor Bugbot for commit 8545022. Bugbot is set up for automated code reviews on this repo. Configure here.

@tanderson-ld
tanderson-ld requested a review from a team as a code owner November 3, 2026 18:35
@tanderson-ld
tanderson-ld merged commit 21e2cd1 into main Nov 3, 2026
13 of 14 checks passed
@tanderson-ld
tanderson-ld deleted the tanderson/publish-jdk-pin branch November 3, 2026 21:31
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 this pull request may close these issues.

2 participants