From d3f3e79c14abc8293f89896be683137ba31fe0b2 Mon Sep 17 00:00:00 2001 From: Aditya Parikh Date: Fri, 20 Nov 2026 17:58:27 -0500 Subject: [PATCH] chore(deps): upgrade to Spring Boot 4.2.0 and Spring AI 2.1.0 - Spring Boot 4.1.1 -> 4.2.0, Spring AI 2.0.1 -> 2.1.0. - Drop the mcp-bom 2.0.1 pin. Spring AI 2.1.0 depends on MCP SDK 2.2.0 itself, and the pin, declared ahead of spring-ai-bom, would have held the SDK back at 2.0.1 under "first declaration wins". - opentelemetry-logback-appender 2.28.1-alpha -> 2.34.0-alpha, the release built against Boot 4.2's OpenTelemetry 1.68.0. The old appender left opentelemetry-api-incubator at 1.62.0-alpha, which fails OpenTelemetrySdk creation with NoClassDefFoundError: io/opentelemetry/api/internal/ConfigUtil. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Aditya Parikh --- AGENTS.md | 13 +++++++------ CHANGELOG.md | 2 +- build.gradle.kts | 8 +------- dev-docs/graalvm-native-image.md | 11 +++++++---- gradle/libs.versions.toml | 15 +++------------ 5 files changed, 19 insertions(+), 30 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 72abf222..45bdb213 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,7 +8,7 @@ Solr MCP Server is a Spring AI Model Context Protocol (MCP) server that enables - **Status:** Apache incubating project (v1.0.0-SNAPSHOT) - **Java:** 25+ (centralized in build.gradle.kts) -- **Framework:** Spring Boot 4.1.1, Spring AI 2.0.1 +- **Framework:** Spring Boot 4.2.0, Spring AI 2.1.0 - **License:** Apache 2.0 ## Common Commands @@ -146,7 +146,7 @@ Configuration files: `application-stdio.properties`, `application-http.propertie ### SBOM Architecture CycloneDX SBOM generation is wired by applying the `org.cyclonedx.bom` plugin, -version **3.4.1**. Spring Boot 4.1.1's `CyclonedxPluginAction` recognises 3.x and +version **3.4.1**. Spring Boot 4's `CyclonedxPluginAction` recognises 3.x and auto-configures the `cyclonedxBom` task (type `org.cyclonedx.gradle.CyclonedxAggregateTask`): it writes `build/reports/cyclonedx/application.cdx.json`, embeds that in the bootJar at `META-INF/sbom/application.cdx.json`, and sets the `Sbom-Format` / `Sbom-Location` @@ -335,8 +335,8 @@ buildpacks (`bootBuildImage -Pnative`). Key configuration: ### Spring Boot 4 Notes -The move from Spring Boot 3.5 / Spring AI 1.1 to Spring Boot 4.1.1 / Spring AI 2.0.1 -([release announcement](https://spring.io/blog/2026/06/12/spring-ai-2-0-0-GA-available-now)) +The move from Spring Boot 3.5 / Spring AI 1.1 to Spring Boot 4 / Spring AI 2 +([Spring AI 2.0 announcement](https://spring.io/blog/2026/06/12/spring-ai-2-0-0-GA-available-now)) changed these things; keep them in mind when reading older docs or PRs: - **Jackson 3:** `tools.jackson.databind` replaces `com.fasterxml.jackson.databind`. Annotations @@ -351,8 +351,9 @@ changed these things; keep them in mind when reading older docs or PRs: - **Observability:** Uses `spring-boot-starter-opentelemetry` for traces, metrics, and log export via OTLP. The `micrometer-tracing-bridge-otel` + manual OTel BOM approach and the Prometheus registry (`/actuator/prometheus`) are gone. -- **MCP SDK:** `io.modelcontextprotocol.sdk:mcp` 2.0.1 via `mcp-bom`, with the Jackson 3 - module (`mcp-json-jackson3`). +- **MCP SDK:** `io.modelcontextprotocol.sdk:mcp`, with the Jackson 3 module + (`mcp-json-jackson3`), at the version Spring AI depends on (2.2.0 under Spring AI + 2.1.0). There is no separate SDK pin; Spring AI 2.0.1 needed one via `mcp-bom`. - **Span naming:** `@Observed` spans use `ClassName#methodName` (PascalCase) instead of the earlier `class-name#method-name` (kebab-case). diff --git a/CHANGELOG.md b/CHANGELOG.md index d8c00aa3..ee277feb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## [Unreleased] -Apache Solr MCP 1.0.0 is the project's first release: a Model Context Protocol (MCP) server that lets AI assistants search, index and manage Apache Solr. It runs over STDIO for desktop and IDE clients, or over HTTP for remote use with OAuth2 authentication on by default. It is built on Spring Boot 4.1 and Spring AI 2.0, works with Solr 9.4 through 10, and ships as a JAR (Java 25), a multi-architecture JVM Docker image and GraalVM native images. +Apache Solr MCP 1.0.0 is the project's first release: a Model Context Protocol (MCP) server that lets AI assistants search, index and manage Apache Solr. It runs over STDIO for desktop and IDE clients, or over HTTP for remote use with OAuth2 authentication on by default. It is built on Spring Boot 4.2 and Spring AI 2.1, works with Solr 9.4 through 10, and ships as a JAR (Java 25), a multi-architecture JVM Docker image and GraalVM native images. ### Added diff --git a/build.gradle.kts b/build.gradle.kts index 36072d6a..6a84e65f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -94,7 +94,7 @@ java { // CycloneDX SBOM // ============== -// What we no longer configure: *output*. Spring Boot 4.1.1's `CyclonedxPluginAction` +// What we no longer configure: *output*. Spring Boot 4's `CyclonedxPluginAction` // auto-configures the `cyclonedxBom` task (type `org.cyclonedx.gradle.CyclonedxAggregateTask`) // for cyclonedx 3.x -- it sets the output to `build/reports/cyclonedx/application.cdx.json` // and makes the bootJar embed it at `META-INF/sbom/application.cdx.json`. The @@ -202,12 +202,6 @@ dependencies { dependencyManagement { imports { - // Declared before spring-ai-bom: the dependency-management plugin uses - // Maven "first declaration wins" semantics. spring-ai-bom does not manage - // the MCP SDK at all -- Spring AI 2.0.1 depends on mcp 2.0.0 directly -- - // so this BOM is what lifts the whole SDK to 2.0.1 as one coherent set - // rather than pinning mcp-core and leaving mcp-json-jackson3 behind. - mavenBom("io.modelcontextprotocol.sdk:mcp-bom:${libs.versions.mcp.sdk.get()}") mavenBom("org.springframework.ai:spring-ai-bom:${libs.versions.spring.ai.get()}") } } diff --git a/dev-docs/graalvm-native-image.md b/dev-docs/graalvm-native-image.md index 930d052a..85f0d97f 100644 --- a/dev-docs/graalvm-native-image.md +++ b/dev-docs/graalvm-native-image.md @@ -204,10 +204,13 @@ four `--initialize-at-build-time` entries in `nativeImageBuildArgs`: proxy classes that cannot be build-time initialized; including it breaks the build. -**OTel dependency alignment.** Spring Boot 4.1 manages the OpenTelemetry SDK -(`opentelemetry-api:1.62.0`) through the starter, so the logback appender is -held at `2.28.1-alpha` — the newest release built against `1.62.0`, whose -transitive `opentelemetry-api-incubator:1.62.0-alpha` matches. A newer appender +**OTel dependency alignment.** Spring Boot 4.2 manages the OpenTelemetry SDK +(`opentelemetry-api:1.68.0`) through the starter, so the logback appender is +held at `2.34.0-alpha` — the newest release built against `1.68.0`, whose +transitive `opentelemetry-api-incubator:1.68.0-alpha` matches. Boot does not +manage the incubator, so a stale appender leaves it behind while the SDK moves +on: on Boot 4.2 the 1.62 incubator fails `OpenTelemetrySdk` creation with +`NoClassDefFoundError: io/opentelemetry/api/internal/ConfigUtil`. A newer appender is built against a newer API that the Boot BOM would downgrade, risking a `NoSuchMethodError` (an older one pulls an incubator lacking `DeclarativeConfigProperties.get(String)`, which SB4's `OpenTelemetrySdk` diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0c7771e9..d89638d2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -16,7 +16,7 @@ # [versions] # Build plugins -spring-boot = "4.1.1" +spring-boot = "4.2.0" spring-dependency-management = "1.1.7" errorprone-plugin = "5.1.1" jib = "3.5.4" @@ -26,18 +26,12 @@ cyclonedx-plugin = "3.4.1" changelog-plugin = "2.5.0" # Main dependencies -spring-ai = "2.0.1" +spring-ai = "2.1.0" solr = "10.0.0" mcp-server-security = "0.1.14" -# MCP Java SDK. Spring AI 2.0.1 pulls 2.0.0 transitively; 2.0.1 fixes error -# handling when a handler is not registered on a stateless server (our HTTP -# profile), empty-completion handling for unmatched refs, and adds bounded -# reads on the HTTP and STDIO transports. Drop this pin once a Spring AI -# release ships 2.0.1 or later itself. -mcp-sdk = "2.0.1" # OpenTelemetry -opentelemetry-logback-appender = "2.28.1-alpha" +opentelemetry-logback-appender = "2.34.0-alpha" commonmark = "0.30.0" @@ -75,9 +69,6 @@ spring-ai-starter-mcp-server-webmvc = { module = "org.springframework.ai:spring- spring-ai-spring-boot-docker-compose = { module = "org.springframework.ai:spring-ai-spring-boot-docker-compose" } spring-ai-spring-boot-testcontainers = { module = "org.springframework.ai:spring-ai-spring-boot-testcontainers" } -# MCP Java SDK (pinned ahead of what Spring AI 2.0.1 resolves; see [versions]) -mcp-bom = { module = "io.modelcontextprotocol.sdk:mcp-bom", version.ref = "mcp-sdk" } - # MCP Security mcp-server-security = { module = "org.springaicommunity:mcp-server-security", version.ref = "mcp-server-security" }