Migrate to Spring Boot 4.0

Proprietary

Migrate applications to the latest Spring Boot 4.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 4.0.

io.moderne.java.spring.boot4.UpgradeSpringBoot_4_0
mod run . --recipe=io.moderne.java.spring.boot4.UpgradeSpringBoot_4_0

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Manage Spring Boot directly when a third-party BOM manages an older version
  2. Add managed Maven dependency org.springframework.retry:spring-retry:2.x
  3. Migrate to Spring Boot 3.5
  4. Migrate OriginLookup metadata to PropertySourceInfo
  5. Convert auto-configuration exclude to excludeName org.springframework.cloud.gateway.config.GatewayRedisAutoConfiguration
  6. Migrate to Spring Cloud 2025.1
  7. Migrate from spring-cloud-contract-wiremock to wiremock-spring-boot
  8. Remove @Bean methods for modules built-in to Jackson 3
  9. Migrate to Spring Framework 7.0
  10. Migrate to Spring Kafka 4.0
  11. Migrate to Spring Security 7.0
  12. Migrate to Spring Batch 6.0
  13. Migrate Spring Boot properties to 4.0
  14. Replace @MockBean and @SpyBean
  15. Migrate to testcontainers-java 2.x
  16. Upgrade to SpringDoc 3.0
  17. Migrate to Spring for GraphQL 2.0
  18. Migrate to Spring AI 2.0
  19. Upgrade Gradle or Maven dependency versions org.springframework.boot:*:4.0.x
  20. Upgrade Gradle or Maven dependency versions org.springframework.boot:spring-boot-dependencies:4.0.x
  21. Upgrade Maven plugin version org.springframework.boot:spring-boot-maven-plugin:4.0.x
  22. Migrate a Spring Boot 3 jackson-bom.version override to jackson-2-bom.version
  23. Upgrade Maven parent project version to org.springframework.boot:spring-boot-starter-parent:4.0.x
  24. Update a Gradle plugin by id org.springframework.boot
  25. Update Gradle wrapper ^8.14-bin
  26. Update a Gradle plugin by id org.jetbrains.kotlin.*
  27. Upgrade Maven plugin version org.jetbrains.kotlin:kotlin-maven-plugin:2.2.x
  28. Upgrade Gradle or Maven dependency versions org.jetbrains.kotlin:*:2.2.x
  29. Migrate @AutoConfigureMockMvc HtmlUnit attributes to nested @HtmlUnit
  30. Co-exclude UserDetailsServiceAutoConfiguration where SecurityAutoConfiguration is excluded
  31. Expand split spring.autoconfigure.exclude entries for Spring Boot 4.0
  32. Replace deprecated RequestMatcherProvider with new API
  33. Migrate to Spring Boot 4.0 modular starters
  34. Add spring-web where spring-boot-starter-json brought it in
  35. Rename Spring Boot 4.0 starters with managed versions
  36. Change Gradle or Maven dependency org.springframework.boot:spring-boot-starter-oauth2-authorization-server
  37. Change Gradle or Maven dependency org.springframework.boot:spring-boot-starter-oauth2-client
  38. Change Gradle or Maven dependency org.springframework.boot:spring-boot-starter-oauth2-resource-server
  39. Change Gradle or Maven dependency org.springframework.boot:spring-boot-starter-web
  40. Change Gradle or Maven dependency org.springframework.boot:spring-boot-starter-web-services
  41. Remove a Gradle or Maven dependency org.springframework.boot:spring-boot-starter-aop
  42. Change Gradle or Maven dependency org.springframework.boot:spring-boot-starter-aop
  43. Upgrade Gradle or Maven dependency versions eu.michael-simons.neo4j:neo4j-migrations-spring-boot-starter:3.0.x
  44. Upgrade Gradle or Maven dependency versions io.github.wimdeblauwe:error-handling-spring-boot-starter:5.0.x
  45. Change Gradle or Maven dependency org.jobrunr:jobrunr-spring-boot-3-starter
  46. Upgrade Gradle or Maven dependency versions org.jobrunr:*:8.x
  47. Add @AutoConfigureTestRestTemplate if necessary
  48. Add @AutoConfigureWebTestClient if necessary
  49. Migrate OpenAPI Generator spring configuration to Spring Boot 4
  50. Migrate jsonschema2pojo configuration to Spring Boot 4
  51. Sync Gradle ext properties with BOM
  52. Upgrade Gradle or Maven dependency versions com.google.cloud:spring-cloud-gcp-*:8.x
  53. Migrate Spring Cloud AWS (awspring) to 4.0
  54. Migrate Spring Cloud Azure to 7.x
  55. Migrate MyBatis to Spring Boot 4.0
  56. Migrate spring-retry to Spring Resilience
  57. Add explicit version for REST Assured
  58. Migrate to Spring HATEOAS 3.0
  59. Migrate to Spring WS 5.0
  60. Migrate to Jakarta EE 11
  61. Migrate to JSpecify
  62. Migrate from Elasticsearch 8 to 9
  63. Migrate to Kafka 4.1
  64. Add @MockitoSettings(strictness = Strictness.LENIENT) for @MockitoBean tests
  65. Add @AutoConfigureMockMvc to @SpringBootTest classes that inject MockMvc or MockMvcTester
  66. Add MongoDB representation properties for UUID and BigDecimal
  67. Replace deprecated org.springframework.boot.autoconfigure.mongo API
  68. Replace deprecated DockerApi
  69. Replace deprecated ThreadPoolTaskSchedulerBuilder constructor
  70. Replace removed RedisCacheConfiguration.getTtl()
  71. Remove HttpMessageConvertersAutoConfiguration references
  72. Migrate PropertyMapper API for Spring Boot 4.0
  73. Pass Function instances to PropertyMapper.Source#as as method references
  74. Configure JAAS for MSSQL Kerberos JDBC connections
  75. Migrate Liquibase property values passed to SpringLiquibase
  76. Replace Kotlin property assignment with setter call
  77. Replace Kotlin property assignment with setter call
  78. Replace Kotlin property assignment with setter call
  79. Replace Kotlin property assignment with setter call
  80. Replace Kotlin property assignment with setter call
  81. Replace Kotlin property assignment with setter call
  82. Replace Kotlin property assignment with setter call
  83. Replace Kotlin property assignment with setter call
  84. Replace Kotlin property assignment with setter call
  85. Flag deprecated ReactorNettyHttpClientMapper for migration
  86. Rename Maven property key spring-authorization-server.version to spring-security.version
  87. Change a Gradle plugin version by id org.cyclonedx.bom
  88. Add spring-boot-starter-validation dependency
  89. Add Jackson2 for Jersey using JSON
  90. Adopt Jackson 3
  91. Migrate JsonFactoryDecorator to TokenStreamFactoryBuilderDecorator
  92. Remove ContentNegotiationConfigurer.favorPathExtension() calls
  93. Migrate Spring Session Hazelcast to Hazelcast Spring Session
  94. Remove Spring Pulsar Reactive support
  95. Remove ZipkinAutoConfiguration exclusions
  96. Remove SslBundles parameter from KafkaProperties build methods
  97. Read servlet web server factory settings through getSettings()
  98. Migrate from Undertow to Tomcat
  99. Migrate Spring Boot 4.0 module starter relocations
  100. Remove redundant properties
  101. Remove redundant explicit dependencies and versions
  102. Remove redundant explicit dependency and plugin versions
  103. Remove loaderImplementation from Gradle
  104. Remove XML tag //configuration/loaderImplementation
  105. Remove the embedded launch script configuration
  106. Find and replace org.springframework.boot.BootstrapContext
  107. Find and replace org.springframework.boot.BootstrapContextClosedEvent
  108. Find and replace org.springframework.boot.BootstrapRegistry
  109. Find and replace org.springframework.boot.BootstrapRegistryInitializer
  110. Find and replace org.springframework.boot.ConfigurableBootstrapContext
  111. Find and replace org.springframework.boot.DefaultBootstrapContext
  112. Find and replace org.springframework.boot.env.EnvironmentPostProcessor
  113. Find and replace org.springframework.boot.actuate.autoconfigure.scheduling.ScheduledTasksObservabilityAutoConfiguration