Skip to content

Support for Spring without Spring Boot#306

Open
pvdbosch wants to merge 23 commits intomainfrom
feature/spring-without-boot
Open

Support for Spring without Spring Boot#306
pvdbosch wants to merge 23 commits intomainfrom
feature/spring-without-boot

Conversation

@pvdbosch
Copy link
Contributor

@pvdbosch pvdbosch commented Feb 24, 2026

Lots of refactoring to enable support for Spring without Spring Boot dependencies.

  • remove scanning (ComponentScan), use explicit @Configuration (application contexts) instead
  • module structure changes:
    • a "-spring" module that can be used without SB. Only the parts that are needed can be imported
      • it includes support for both Jackson2 and Jackson3 alongside each other; allowing to delete the "-core" modules
    • added "-starter" to the name of the modules with autoconfiguration active, these have SB dependencies (except the "-spring-boot-3" one for backwards compatibility)
  • renamed packages to add ".server" and ".client" where applicable
  • avoid exposing abstract classes to Spring users:
    • add WebClientFilter extracting PROBLEM_FILTER from AbstractProblemWebClientCustomizer
    • add an interface ProblemResponseErrorHandler
  • add an annotation @EnableProblemModule(beanValidation=true, swaggerRequestValidation=false, ...) to enable easy activation in non SB-environment

Other:

  • NoResourceFoundExceptionHandler merged into RoutingExceptionHandler (the split was bc NoResourceFoundException was new in SBv3)
  • changed packages of spring integration tests to add ".it" to avoid interference of their own component scanning with the rest-problem packages
  • for configuration, changed to @Value instead of @ConfigurationProperties to cut dependency to spring boot

TODO:

  • review by others
  • update documentation
  • investigate issue: using EnableProblemModule intellij shows issues that beans aren't found, while tests doe work
  • add integration tests for server/client usage w/o starters

- create autoconfiguration for each client or server module, without componentscan
- move integration tests to a subpackage to avoid autowiring problems with the problem modules
- add missing @bean annotations
- move error and exception handlers to common spring module
@pvdbosch pvdbosch marked this pull request as draft February 24, 2026 10:17
@pvdbosch
Copy link
Contributor Author

@jpraet , could you review if the changes in the PR look good to you high-level?

I've tested it locally in a Spring (non-Boot) project using the @EnableProblemModule annotation.
If OK, we'll continue work on the remaining TODOs after which a more detailed review can be done.

@jpraet
Copy link
Contributor

jpraet commented Feb 25, 2026

@jpraet , could you review if the changes in the PR look good to you high-level?

Looks good to me high-level. Thank you

@pvdbosch
Copy link
Contributor Author

pvdbosch commented Mar 3, 2026

The PR is now ready for review.

I made following changes, on top of the previous ones:

  • added an integration test for spring-only.
    • It uses spring boot to provide an application server, but with minimal starters/autoconfiguration.
    • RestTemplate isn't tested because needs invasive test refactoring and it's is on its way out anyway in Spring 8
  • updated documentation
  • modified how the belgif-rest-problem-it-common-jakarta module is generated (transform source instead of jar) to make it easier to debug integration tests
  • remove abstract classes for customizers in spring module, bc they're spring-boot-specific functionality and have very little code

@pvdbosch pvdbosch marked this pull request as ready for review March 3, 2026 12:57
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2026

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