From 14fe69003f8c42bb447f12e1bb98c69b68eb9b91 Mon Sep 17 00:00:00 2001 From: Donald Pinckney Date: Fri, 1 May 2026 11:29:06 -0400 Subject: [PATCH 1/2] ci: bump Code format job to Java 17 The springai sample modules require Java 17 (Spring AI 1.1 needs Spring Boot 3.x, which needs Java 17). Running spotlessCheck on Java 11 made google-java-format choke on text blocks in those sources with "unclosed string literal" errors. Bump the format job's setup-java to 17 so it can parse the springai sources. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3c93696..aa5f209b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,11 +42,14 @@ jobs: - name: Set up Java uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 with: - java-version: "11" + # The springai sample modules require Java 17 (Spring AI 1.1 needs + # Spring Boot 3.x, which needs Java 17). google-java-format has to + # run on Java 17 to parse those sources. + java-version: "17" distribution: "temurin" - name: Set up Gradle uses: gradle/actions/setup-gradle@ac396bf1a80af16236baf54bd7330ae21dc6ece5 # v6 - + - name: Run copyright and code format checks run: ./gradlew --no-daemon spotlessCheck From 9dd4c67aba12c67e6f1a2423c71cf356829ddb9f Mon Sep 17 00:00:00 2001 From: Donald Pinckney Date: Fri, 1 May 2026 11:39:20 -0400 Subject: [PATCH 2/2] Bump project to Java 17 across the board Spring AI requires Java 17, but parts of the build (CI Docker image, root Java target, format-job JDK) were still pinned to Java 11. The follow-on for the spring-ai work was a partial bump that only fixed the format job. This finishes the bump everywhere: - docker/github/Dockerfile: eclipse-temurin:11-focal -> :17-jammy. This is the image the unittest CI job runs ./gradlew test inside. - build.gradle: drop the Spring-Boot-version-conditional Java target (Spring Boot 2.7 runs fine on Java 17, so there's no reason to pin source/target compatibility to 11). - springboot-basic/build.gradle: drop a dead isJava11Compatible() branch (both arms were identical). - ci.yml: keep Java 17 for the format job; clean up the inline comment that framed it as a springai-only exception. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 3 --- build.gradle | 9 ++------- docker/github/Dockerfile | 2 +- springboot-basic/build.gradle | 6 +----- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa5f209b..d012e1fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,9 +42,6 @@ jobs: - name: Set up Java uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 with: - # The springai sample modules require Java 17 (Spring AI 1.1 needs - # Spring Boot 3.x, which needs Java 17). google-java-format has to - # run on Java 17 to parse those sources. java-version: "17" distribution: "temurin" diff --git a/build.gradle b/build.gradle index ab292b3b..8e476ad7 100644 --- a/build.gradle +++ b/build.gradle @@ -14,13 +14,8 @@ subprojects { } java { - if(project.property("springBootPluginVersion") == "2.7.13") { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } else { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } ext { diff --git a/docker/github/Dockerfile b/docker/github/Dockerfile index 9a5836a6..9ae87f81 100644 --- a/docker/github/Dockerfile +++ b/docker/github/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:11-focal +FROM eclipse-temurin:17-jammy # Git is needed in order to update the dls submodule RUN apt-get update && apt-get install -y wget protobuf-compiler git diff --git a/springboot-basic/build.gradle b/springboot-basic/build.gradle index abb58290..0a76fcef 100644 --- a/springboot-basic/build.gradle +++ b/springboot-basic/build.gradle @@ -9,11 +9,7 @@ dependencies { runtimeOnly "io.micrometer:micrometer-registry-prometheus" dependencies { errorproneJavac('com.google.errorprone:javac:9+181-r4173-1') - if (JavaVersion.current().isJava11Compatible()) { - errorprone('com.google.errorprone:error_prone_core:2.28.0') - } else { - errorprone('com.google.errorprone:error_prone_core:2.28.0') - } + errorprone('com.google.errorprone:error_prone_core:2.28.0') } }