Skip to content

feat!: support of Spring Boot 4 - #65

Merged
philipaconrad merged 1 commit into
open-policy-agent:mainfrom
tgrafford:upgrade-to-spring-boot-v4.x
Apr 10, 2026
Merged

feat!: support of Spring Boot 4#65
philipaconrad merged 1 commit into
open-policy-agent:mainfrom
tgrafford:upgrade-to-spring-boot-v4.x

Conversation

@tgrafford

Copy link
Copy Markdown
Contributor

BREAKING CHANGE: library no longer works with Spring Boot 3

This PR closes issue #59.

🔩 What code changed, and why?

Spring Boot upgraded to version 4.0.3 (latest as of writing). This included:

  • Upgraded Gradle to v8.14.3
  • Use the renamed module dependencies from Spring Boot 4
    • This introduced some minor refactoring related to interface and package structure of classes used
  • Introduce testing dependencies for each module included
  • Make use of JSpecify null-safety (introduced in Spring Boot 4)
    • This also included some minor refactoring where possible null-values was not handled as expected

👍 Definition of done

  • opa-spring-boot is now compatible with Spring Boot 4

👟 How to test

The testing assumes you already have a Spring Boot application using opa-springboot and the application has been upgraded to Spring Boot 4 but does not compile.

  1. Edit version in gradle.properties to version=2.0.0-LOCAL
  2. Run ./gradlew clean build publishToMavenLocal
  3. Edit dependencies in your Spring Boot application to use opa-springboot version 2.0.0-LOCAL
    Note: Ensure your application resolves dependencies from your local maven registry.
  4. Build your application
  5. (Optional) Run and test your application, either using ./gradlew bootRun or ./mvn spring-boot:run depending on build tool used.

⛓️ Related Resources

@tgrafford
tgrafford force-pushed the upgrade-to-spring-boot-v4.x branch 6 times, most recently from 4e0c7e8 to 6ad9781 Compare March 16, 2026 09:20
@philipaconrad

Copy link
Copy Markdown
Member

@tgrafford Thank you for the PR! I haven't looked at this repository in a long while, and only have done occasional maintenance on it since the original creator stepped away. I don't work actively in Java these days, so I strongly appreciate that you took the time to do a version upgrade like this.

This repo needs a few Github Actions upgrades and bugfixes to go in before this PR will go green on CI, which I'm working on presently. Once those are in, I'll review the PR, and we should be able to go from there.

Apologies for not noticing the PR sooner-- my Github notifications are flooded at all times, so this PR slipped through the cracks.

@philipaconrad philipaconrad left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not particularly familiar with Spring Boot bits, but the OPA-related side of the changes seem fine, and the nullable annotations look good as well. I'm marking approve, so that we can finally get this set of changes rolled in. Thanks again @tgrafford!

BREAKING CHANGE: library no longer works with Spring Boot 3

Signed-off-by: Tim Grafford <tim@grafford.dev>
@philipaconrad
philipaconrad force-pushed the upgrade-to-spring-boot-v4.x branch from 6ad9781 to cb07d67 Compare April 10, 2026 18:07
@philipaconrad

Copy link
Copy Markdown
Member

ℹ️ Rebasing the PR through the Github Web UI to catch up with main before merging...

@philipaconrad
philipaconrad merged commit 5904f6e into open-policy-agent:main Apr 10, 2026
5 checks passed
@tgrafford
tgrafford deleted the upgrade-to-spring-boot-v4.x branch April 10, 2026 18:22
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