Skip to content

major: Spring boot 4.1.2 upgrade - #163

Merged
mjahn2 merged 2 commits into
cloudflightio:masterfrom
mmihailescu98:feature/spring-boot-4
Nov 16, 2026
Merged

mjahn2 merged 2 commits into
cloudflightio:masterfrom
mmihailescu98:feature/spring-boot-4

Conversation

@mmihailescu98

Copy link
Copy Markdown
Contributor

No description provided.

mapperBuilder
.addModule(kotlinModule())
.changeDefaultPropertyInclusion {
JsonInclude.Value.construct(JsonInclude.Include.NON_EMPTY, JsonInclude.Include.NON_EMPTY)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

content Inclusion was not set to NON_EMPTY before only value inclusion was, so that would not omit keys with empty values from getting serialized, potentially causing problems on deserialization -suggestion:

Suggested change
JsonInclude.Value.construct(JsonInclude.Include.NON_EMPTY, JsonInclude.Include.NON_EMPTY)
JsonInclude.Value.construct(JsonInclude.Include.NON_EMPTY, JsonInclude.Include.USE_DEFAULTS)

@mjahn2

mjahn2 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Redis serialization changed drastically, we have a fallback to delete invalid keys - but lets add a migration step to manually flush the cache during deployment to be sure nothing which was written with spring boot 3 to redis will get deserialized to spring boot 4 - which could cause issues

@mjahn2

mjahn2 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

In Spring Boot 4.0 the interface moved to org.springframework.boot.EnvironmentPostProcessor. The old org.springframework.boot.env.EnvironmentPostProcessor is deprecated and will be removed in a later 4.x release.

Recommendation: switch the import and the spring.factories key to org.springframework.boot.EnvironmentPostProcessor. While you are there, fix the KDoc, which says "server.port - 1000" while the code adds + 10000.

@mjahn2

mjahn2 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Boot 4 renamed the servlet starter to spring-boot-starter-webmvc. The old name is only kept as a deprecated alias. Also, i18n, tracing and validation pull a full web starter (including Tomcat) as implementation into every consumer.

Recommendation: switch to spring-boot-starter-webmvc. In library modules, prefer the narrower modules (spring-boot-webmvc, spring-webmvc) as compileOnly/implementation together with @ConditionalOnClass, so the platform does not decide the server for the application.

@mjahn2

mjahn2 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

In Boot 4, spring-boot-starter-test no longer contains the technology-specific test auto-configuration (@WebMvcTest, @DataJpaTest, @AutoConfigureMockMvc, …). The PR correctly adds spring-boot-webmvc-test for its own modules, but the platform test BOM still only exposes spring-boot-starter-test. Downstream projects will fail to compile.

Recommendation: add the matching test starters as api where the platform claims support: spring-boot-starter-webmvc-test in platform-spring-test, and spring-boot-starter-data-jpa-test in platform-spring-test-jpa, which is otherwise almost empty after the QuickPerf removal. Alternatively, document spring-boot-starter-test-classic as a transition aid.

@mjahn2

mjahn2 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

think the whole platform should be moved to java 21? and java 17 artifact target can be changed

@mjahn2

mjahn2 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

as spring boot 4.0 is reaching eol soon - it would make sense to target 4.1 already

@mjahn2

mjahn2 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

add an "Upgrading to Spring Boot 4" section to the readme that covers:

  • Removed: QuickPerf (suggest an alternative such as Hibernate statistics or datasource-proxy for SQL-count assertions) and Springfox (use springdoc-openapi).
  • Jackson 3 package changes (tools.jackson.*; annotations stay in com.fasterxml) and the new default settings.
  • Cache flush or key-prefix bump, and invalidated sessions.
  • Java 21 is required for platform-spring-test-bdd; JGiven junit6 extension.
  • Test-slice starters, spring-boot-starter-webmvc.
  • A link to the official Spring Boot 4.0 Migration Guide.

Also use a major: commit/PR prefix so that Reckon bumps the major version. The previous upgrades used minor:/patch:.

@mmihailescu98 mmihailescu98 changed the title Spring boot 4 upgrade major: Spring boot 4.1.2 upgrade Nov 12, 2026
@mjahn2
mjahn2 merged commit 4701dea into cloudflightio:master Nov 16, 2026
1 check passed
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