Skip to content

chore(samples/java): bump to Spring Boot 4.0.6, spring-dotenv 5.1.0, keytool 2.0.2#145

Merged
ksroda-sa merged 3 commits into
mainfrom
chore/java-bump-spring-boot-4
May 13, 2026
Merged

chore(samples/java): bump to Spring Boot 4.0.6, spring-dotenv 5.1.0, keytool 2.0.2#145
ksroda-sa merged 3 commits into
mainfrom
chore/java-bump-spring-boot-4

Conversation

@ksroda-sa
Copy link
Copy Markdown
Collaborator

Summary

Brings the 3 Java samples (login-auth-code, token-refresh, saml-sp-login) onto the latest GA versions of every dep. The Spring Boot 3.4 → 4.0 jump pulls Spring Framework 6 → 7 and Spring Security 6 → 7 as transitive consequences; this PR includes the small code changes those needed.

Bumps

Dependency Before After
spring-boot-starter-parent 3.4.1 4.0.6 (latest GA — 4.1.x is RC)
org.codehaus.mojo:keytool-maven-plugin 1.7 2.0.2
me.paulschwarz:spring-dotenv 4.0.0 springboot4-dotenv 5.1.0 (v5 split by Boot version)
All Spring deps managed by parent (3.x line) latest 4.0.x via parent BOM

Code changes

All 3 samples (ApplicationTests.java)

  • AutoConfigureMockMvc moved out of spring-boot-test-autoconfigure into a new dedicated module spring-boot-webmvc-test (added as test-scope dep) and its package changed: org.springframework.boot.test.autoconfigure.web.servletorg.springframework.boot.webmvc.test.autoconfigure.

saml-sp-login (Application.java) — Spring Security 7 dropped two things we used:

  • OpenSaml4AuthenticationProviderOpenSaml5AuthenticationProvider. Same API surface (createDefaultResponseValidator, createDefaultAssertionValidatorWithParameters, setResponseValidator, setAssertionValidator), just renamed.
  • org.springframework.security.web.util.matcher.AntPathRequestMatcher was removed. Replaced with PathPatternRequestMatcher.withDefaults().matcher("/logout") from o.s.s.web.servlet.util.matcher. .matcher(path) without an explicit HTTP method matches any method, preserving the existing "GET on /logout works" behavior.

🤖 Generated with Claude Code

ksroda-sa and others added 2 commits May 6, 2026 15:09
…+ keytool 2.0.2

Brings all 3 Java samples to the latest GA versions of every dep:

- spring-boot-starter-parent 3.4.1 → 4.0.6 (latest GA — 4.1.x is RC)
- keytool-maven-plugin 1.7 → 2.0.2 (latest)
- me.paulschwarz:spring-dotenv 4.0.0 → springboot4-dotenv 5.1.0
  (v5 split the artifact by Boot version; we now use the Boot 4 module)

Required code changes for the Spring Boot 4 / Spring Security 7 jump:

- AutoConfigureMockMvc moved from spring-boot-test-autoconfigure to a new
  spring-boot-webmvc-test module (added as test-scope dep) and changed
  package: org.springframework.boot.test.autoconfigure.web.servlet →
  org.springframework.boot.webmvc.test.autoconfigure.
- Spring Security 7 dropped OpenSAML 4: OpenSaml4AuthenticationProvider →
  OpenSaml5AuthenticationProvider (same API surface, just renamed).
- Spring Security 7 removed AntPathRequestMatcher from
  o.s.s.web.util.matcher: replaced with
  PathPatternRequestMatcher.withDefaults().matcher(path) at
  o.s.s.web.servlet.util.matcher (matches any HTTP method when no method
  is provided, matching the existing "GET on /logout" behavior).

snippets.json regenerated because line numbers in saml-sp-login's
Application.java shifted due to the matcher comment update.

11/11 tests pass across all 3 samples on the new stack:
  login-auth-code: 3/3, token-refresh: 5/5, saml-sp-login: 3/3.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Local Package.resolved had 2.0.0 cached from earlier AppAuth-iOS bump
experiments, while project.yml on this branch is still 1.7.6. The
extractor prefers Package.resolved over project.yml (more precise), so
the locally-regenerated snippets.json carried 2.0.0 — but CI does a
fresh checkout where Package.resolved (gitignored) doesn't exist, so it
falls back to project.yml and reads 1.7.6. The drift check failed.

Re-ran the extractor against a clean workspace (no Package.resolved) so
local output matches CI's view.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ksroda-sa ksroda-sa marked this pull request as ready for review May 6, 2026 13:24
Copilot AI review requested due to automatic review settings May 6, 2026 13:24
@ksroda-sa ksroda-sa requested a review from a team as a code owner May 6, 2026 13:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Java Spring Boot samples to Spring Boot 4.0.6 (and corresponding Spring Framework/Security 7.x transitive upgrades), adjusting sample code and test dependencies to match module/package moves introduced in Boot/Security 7. Also updates snippet metadata versions to reflect the new dependency baseline.

Changes:

  • Bump Spring Boot parent to 4.0.6 across Java samples; switch spring-dotenv to the Boot-4-specific springboot4-dotenv 5.1.0.
  • Fix test compilation under Boot 4 by importing AutoConfigureMockMvc from its new package and adding spring-boot-webmvc-test as a test dependency.
  • Update the SAML sample for Spring Security 7 by migrating OpenSaml4AuthenticationProviderOpenSaml5AuthenticationProvider and replacing the removed AntPathRequestMatcher usage.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
snippets.json Updates reported lib_version values for the Java snippets and also adjusts the iOS AppAuth-iOS version metadata.
samples/java/login-auth-code/pom.xml Bumps Boot parent, swaps dotenv artifact, adds spring-boot-webmvc-test, bumps keytool plugin.
samples/java/login-auth-code/src/test/java/com/secureauth/quickstart/ApplicationTests.java Updates AutoConfigureMockMvc import to Boot 4 location.
samples/java/token-refresh/pom.xml Bumps Boot parent, swaps dotenv artifact, adds spring-boot-webmvc-test, bumps keytool plugin.
samples/java/token-refresh/src/test/java/com/secureauth/quickstart/ApplicationTests.java Updates AutoConfigureMockMvc import to Boot 4 location.
samples/java/saml-sp-login/pom.xml Bumps Boot parent, swaps dotenv artifact, adds spring-boot-webmvc-test, bumps keytool plugin.
samples/java/saml-sp-login/src/main/java/com/secureauth/quickstart/Application.java Migrates to OpenSaml5AuthenticationProvider and replaces AntPathRequestMatcher with PathPatternRequestMatcher.
samples/java/saml-sp-login/src/test/java/com/secureauth/quickstart/ApplicationTests.java Updates AutoConfigureMockMvc import to Boot 4 location.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread snippets.json Outdated
@ksroda-sa ksroda-sa merged commit b9f84bf into main May 13, 2026
23 checks passed
@ksroda-sa ksroda-sa deleted the chore/java-bump-spring-boot-4 branch May 13, 2026 08:39
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.

3 participants