[WIP] Upgrade spring-boot-starter from version 2.7.x to 3.3.x
Pull Request type
- [ ] Bugfix
- [ ] Feature
- [x] Refactoring (no functional changes, no api changes)
- [x] Build related changes (Please run
./gradlew build --write-locksto refresh dependencies) - [x] Other (please describe)
Dependency upgrade: Upgrading spring-boot from version
2.7.+to3.3.+
NOTE: Please remember to run ./gradlew spotlessApply to fix any format violations.
Changes in this PR
- Upgrade
spring-boot-starter-webandspring-boot-starter-testfrom version2.7.+to3.3.+. - Moved from
javaxpackages tojakartapackages. See: Spring-Boot-3.0-Migration-Guide#jakarta-ee - Added Apache bVal as the implementation of Bean Validation 3.0 (
jakarta.validation-api). - Remove
@ConstructorBinding. See: @ConstructingBinding No Longer Needed at the Type Level
Note: Why Apache bVal and not Hibernate Validator or Spring Boot Validator?
A: Firstly, Spring Boot Validator transitively depends on Hibernate Validator, so using either of them provides the same underlying Bean Validation implementation.
The problem with using Hibernate Validator is that it breaks the existing tests.
What I noticed is that validator.validate(...) would always raise twice the number of violations. One of which is the actual violation and the other with empty values. I tried to find the cause, and came across a few threads with some not so convincing explanations and workarounds, none of which seemed to work. And after spending a good few hours trying to figure the problem, I still couldn't understand why I was seeing that behavior.
In the end, I gave BVal a shot, and it worked fine on the first try. Anyway, BVal supports Bean Validation 3.0, is TCK certified and is being updated frequently. So, I didn't see any reason not to go with it. Also, if we indeed want to use some different implementation in the future; we just have to remove the BVal dependency and add whatever else we want to use.
https://github.com/Netflix/maestro/issues/8 is the issue.
Okay, I just found out this needs work. This causes problems with the way the project uses Jackson. Will spend some time to see how I can fix that.
Close the PR as this has been done by #105