Skip to content

feat: Spring Boot 4 + Spring AI 2.0 upgrade#23

Open
adityamparikh wants to merge 1 commit into
apache:mainfrom
adityamparikh:sb4
Open

feat: Spring Boot 4 + Spring AI 2.0 upgrade#23
adityamparikh wants to merge 1 commit into
apache:mainfrom
adityamparikh:sb4

Conversation

@adityamparikh

@adityamparikh adityamparikh commented Dec 13, 2025

Copy link
Copy Markdown
Contributor

Upgrades the Solr MCP server to Spring Boot 4.1.0 and Spring AI 2.0.0 GA.

This PR is scoped to the Spring Boot 4 / Spring AI 2.0 upgrade only. It is rebased onto the latest main as a single commit. Changes that had accumulated on the sb4 branch but are unrelated to the upgrade (CI Solr-version-matrix tweaks, Solr 10 /admin/metrics test skips, the docker-image-tag-suffix helper superseded by #139, and cosmetic refactors) have been intentionally excluded.

Highlights

  • Jackson 3: tools.jackson.databind replaces com.fasterxml.jackson.databind (annotations stay in com.fasterxml.jackson.annotation); the MCP SDK uses mcp-json-jackson3. JacksonException replaces IOException/JsonProcessingException; JsonNode.properties()/asString() replace fields()/asText().
  • MCP annotations: package moved org.springaicommunity.mcp.annotationorg.springframework.ai.mcp.annotation (now part of Spring AI core).
  • Modular starters: spring-boot-starter-web-webmvc + -json; explicit spring-ai-autoconfigure-mcp-server-common (no longer transitive after Spring AI 2.0.0-M7); modular test starters.
  • Observability: spring-boot-starter-opentelemetry (SB4 idiomatic) for traces, metrics, and OTLP log export, replacing the manual OTel BOM + micrometer-tracing-bridge-otel approach; spring-boot-starter-aspectj for @Observed; OTel logback appender installed programmatically via InstallOpenTelemetryAppender; management.opentelemetry.* OTLP properties.
  • Testcontainers 2.x module/package renames.
  • JSpecify is built into Spring Boot 4, so the explicit dependency is dropped.
  • GraalVM native: AOT NullAway exclusions, JUnit-platform build-time init, DefaultMetaProvider + Solr API model reflection hints, per-profile AOT docs; dependency-resolution alignment for opentelemetry-proto and opentelemetry-api-incubator against the SB 4.1.0 BOM.

Both Spring Boot 4.1.0 and Spring AI 2.0.0 are GA on Maven Central, so no milestone repositories are required.

Verification

./gradlew build --refresh-dependencies passes locally on JDK 25: 346 tests, 0 failures, 0 errors (7 skipped), including the Testcontainers integration tests against real Solr.

References

🤖 Generated with Claude Code

@adityamparikh adityamparikh marked this pull request as draft December 16, 2025 22:10
@adityamparikh

Copy link
Copy Markdown
Contributor Author

Currently using Milestone version of Spring AI 2.0. Will make it ready for review once Spring AI 2.0 is GA.

@epugh

epugh commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for the update on this one... We will merge when we get an official Spring AI 2.0 release!

@epugh epugh changed the title feat: Spring Boot 4 upgrade feat: Spring Boot 4 + Spring AI 2.0 upgrade Jan 6, 2026
epugh pushed a commit that referenced this pull request Mar 9, 2026
* feat: implement observability with OpenTelemetry and Micrometer, add logging configuration, and enable tracing with annotation support

* test(observability): implement distributed tracing tests for Spring Boot 3.5

Add comprehensive distributed tracing test suite using SimpleTracer from
micrometer-tracing-test library. This is the Spring Boot 3-native approach
for testing observability without requiring external infrastructure.

Key changes:
- Add DistributedTracingTest with 6 passing tests for @observed methods
- Add OpenTelemetryTestConfiguration providing SimpleTracer as @primary bean
- Add OtlpExportIntegrationTest (disabled due to Jetty dependency issue)
- Add LgtmAssertions and TraceAssertions utility classes
- Add micrometer-tracing-bridge-otel to bridge Observation API to OpenTelemetry
- Add spring-boot-starter-aop for @observed annotation support
- Add test dependencies: micrometer-tracing-test, awaitility, Jetty modules

Test results:
- DistributedTracingTest: 6/6 tests passing
- Spans successfully captured from @observed annotations
- Build: SUCCESS (219 tests passing, 0 failures)

Spring Boot 3.5 uses Micrometer Observation → Micrometer Tracing → OpenTelemetry
bridge, which differs from Spring Boot 4's direct OpenTelemetry integration.

Adapted from PR #23 (Spring Boot 4 implementation) with modifications for
Spring Boot 3.5 architecture and APIs.

---------

Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@adityamparikh

Copy link
Copy Markdown
Contributor Author

Re-triggering CI now that ci.yml has landed on main (#117).

@epugh

epugh commented May 2, 2026

Copy link
Copy Markdown
Contributor

Looks like you have some conflicts.. I think you need to update from main to pick up the new ci stuff?

Migrate the Solr MCP server from Spring Boot 3.5.x / Spring AI 1.1.x to
Spring Boot 4.1.0 and Spring AI 2.0.0 GA.

Highlights:
- Jackson 3: tools.jackson.databind replaces com.fasterxml.jackson.databind
  (annotations stay in com.fasterxml.jackson.annotation); the MCP SDK uses the
  mcp-json-jackson3 module. JacksonException replaces IOException/
  JsonProcessingException; JsonNode.properties()/asString() replace
  fields()/asText().
- MCP annotations: package moved from org.springaicommunity.mcp.annotation to
  org.springframework.ai.mcp.annotation (now part of Spring AI core).
- Modular starters: spring-boot-starter-web -> -webmvc + -json; explicit
  spring-ai-autoconfigure-mcp-server-common (no longer pulled transitively
  after Spring AI 2.0.0-M7); modular test starters (actuator / opentelemetry /
  webmvc).
- Observability: spring-boot-starter-opentelemetry (SB4 idiomatic) for traces,
  metrics, and OTLP log export, replacing the manual OTel BOM +
  micrometer-tracing-bridge-otel approach; spring-boot-starter-aspectj for
  @observed; OpenTelemetry logback appender installed programmatically via
  InstallOpenTelemetryAppender; management.opentelemetry.* OTLP properties.
- Testcontainers 2.x module/package renames.
- JSpecify is built into Spring Boot 4, so the explicit dependency is dropped.
- GraalVM native: AOT NullAway exclusions for generated sources, JUnit-platform
  build-time init, DefaultMetaProvider + Solr API model reflection hints, and
  per-profile AOT documentation; dependency-resolution alignment for
  opentelemetry-proto and opentelemetry-api-incubator against the Spring Boot
  4.1.0 BOM.

Both Spring Boot 4.1.0 and Spring AI 2.0.0 are GA on Maven Central, so no
milestone repositories are required.

Scope is limited to the Spring Boot 4 / Spring AI 2.0 upgrade and its required
changes; unrelated CI, Solr-version-matrix, and Solr 10 metrics changes are
intentionally excluded.

Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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