The main issue is not Java 11 -> 21 but Spring 2.7 -> 3.2.5. there were many MANY changes in some APIs, starting for all javax dependencies and more importantly spring security.
I literally just finished a Spring Boot 2.6.x to 3.2.x upgrade for a lot of services a couple of weeks back.
The javax -> jakarta migration can be handled by IntelliJ: Refactor -> Migrate Packages and Classes -> Java EE to Jakarta EE
Spring Security wasn't too bad, their JavaDoc lists the deprecations and replacements. The only confusing part was figuring out the difference between a securityMatcher and a requestMatcher. The documentation is abysmal regarding this. A securityMatcher indicates if a SecurityFilterChain is even eligible to be used by a path, then the requestMatcher configures the security for those endpoints like in previous versions of Spring Security. Also, it is first match, so make sure the @Order annotation orders SecurityFilterChains from the most specific securityMatcher to least specific (if you have more than one in an app).
if you use hibernate it has gone from 5.6 to 6.x, there were a couple of gotchas here (like normal when using hibernate), but nothing too bad
If you use the H2 database for testing it went from 1.x to 2.x, some unit tests that were passing may stop passing, the H2 2.x migration guide had most of the answers.
If you use Apache HttpClient it goes from 4.x to 5.x, this was honestly a bigger PITA than the Spring Security migration.
View all comments
Show parent comment
1
u/Ewig_luftenglanz Jun 11 '24
The main issue is not Java 11 -> 21 but Spring 2.7 -> 3.2.5. there were many MANY changes in some APIs, starting for all javax dependencies and more importantly spring security.