Index of every page on this site: llms.txt
All skills
github avatar

/spring-boot-4-migration

@f10fdb8 official
by githubgithub/awesome-copilot42k stars
5,426
Run it yourself

Migrate a Spring Boot 3.x application to Spring Boot 4.0 (Spring Framework 7, Jackson 3, modular starters, JSpecify). Use only for an explicit Boot 3.x to 4 migration, or to fix build or test failures caused by it, or to review one. Not for 3.x patch bumps or 4.0 to 4.1 upgrades; follow the target Boot version release notes and upgrade guide for those. Covers Maven and Gradle (Kotlin DSL, version catalogs).

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/spring-boot-4-migration

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

references11-checklist-pitfalls-resources.md

≈1.5k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Migration Checklist

Pre-Migration

Core Migration

  • Update libs.versions.toml with the selected current Spring Boot 4.0.x patch
  • Update Kotlin version to 2.2.0+
  • Rename starters: spring-boot-starter-web → spring-boot-starter-webmvc, etc.
  • Add technology-specific test starters (or use classic starters temporarily)
  • Remove Undertow dependency if present (switch to Tomcat/Jetty)
  • Remove spring-session-hazelcast / spring-session-mongodb or add explicit versions

Jackson 3 Migration

  • Update imports: com.fasterxml.jackson → tools.jackson
  • Update exception: jackson-annotations still uses com.fasterxml.jackson.core
  • Rename: @JsonComponent → @JacksonComponent
  • Rename: Jackson2ObjectMapperBuilderCustomizer → JsonMapperBuilderCustomizer
  • Review Boot 3 spring.jackson.parser.* / spring.jackson.generator.* settings against Jackson 3's spring.jackson.json.read.* / spring.jackson.json.write.* features; verify each feature name and behavior rather than mechanically replacing prefixes
  • Review databind settings separately: spring.jackson.deserialization.* / spring.jackson.serialization.* may move to spring.jackson.datatype.enum.* or spring.jackson.datatype.datetime.* (see 03-jackson-3.md)
  • Consider temporary spring-boot-jackson2 module if needed

Property Updates

  • MongoDB: spring.data.mongodb.* → spring.mongodb.* (for non-Spring Data properties)
  • Session: spring.session.redis.* → spring.session.data.redis.*
  • Persistence: spring.dao.exceptiontranslation → spring.persistence.exceptiontranslation
  • Kafka retry: backoff.random → backoff.jitter

Code Updates

  • Update package: BootstrapRegistry → org.springframework.boot.bootstrap.BootstrapRegistry
  • Update package: EnvironmentPostProcessor → org.springframework.boot.EnvironmentPostProcessor
  • Update package: EntityScan → org.springframework.boot.persistence.autoconfigure.EntityScan
  • Update: RestClient → Rest5Client (Elasticsearch)
  • Update: StreamsBuilderFactoryBeanCustomizer → StreamsBuilderFactoryBeanConfigurer (Kafka)
  • Split: RabbitRetryTemplateCustomizer → RabbitTemplateRetrySettingsCustomizer / RabbitListenerRetrySettingsCustomizer
  • Replace: HttpMessageConverters → ClientHttpMessageConvertersCustomizer / ServerHttpMessageConvertersCustomizer
  • Update: PropertyMapper usage with .always() if null handling needed

Testing Updates

  • Add @ExtendWith(MockitoExtension::class) to tests using @Mock / @Captor
  • Add @AutoConfigureMockMvc to tests using MockMvc
  • Add @AutoConfigureWebTestClient to tests using WebTestClient
  • Migrate TestRestTemplate → RestTestClient (or add @AutoConfigureTestRestTemplate)
  • Update: @PropertyMapping imports → org.springframework.boot.test.context

Build Configuration

  • Update Gradle to 8.14+
  • Update Gradle CycloneDX plugin to 3.0.0+
  • Review optional dependency inclusion in uber jars
  • Remove loaderImplementation = CLASSIC if present
  • Remove launchScript() configuration if present

Verification

  • Run ./gradlew clean build
  • Run full test suite
  • Verify integration tests with TestContainers
  • Check for new Kotlin null-safety warnings
  • Test Spring Boot Actuator endpoints
  • Verify health probes (/actuator/health/liveness, /actuator/health/readiness)
  • Performance test with new defaults

Post-Migration

  • Review Spring Boot 4.0 release notes for additional features
  • Consider adopting new Spring Framework 7.0 features
  • Plan migration away from classic starters (if used)
  • Plan migration away from spring-boot-jackson2 module (if used)
  • Update CI/CD pipelines for Java 17+ requirement
  • Update deployment manifests (Servlet 6.1 containers)

Common Pitfalls

  1. Classic starters: Remember these are deprecated - plan migration to technology-specific starters
  2. Undertow: Completely removed, no workaround - must use Tomcat or Jetty
  3. Jackson 3 packages: Easy to miss jackson-annotations still using old group ID
  4. MongoDB properties: Many moved to spring.mongodb.* but some remain in spring.data.mongodb.*
  5. Test configuration: @SpringBootTest no longer auto-configures MockMVC/WebTestClient/TestRestTemplate
  6. Kotlin 2.2: Required minimum - older versions won't work
  7. Null-safety: JSpecify annotations may surface new warnings in Kotlin
  8. PropertyMapper: Behavioral change with null handling - review usage
  9. Jersey + Jackson 3: Incompatible - use spring-boot-jackson2 module
  10. Health probes: Now enabled by default - may affect non-Kubernetes deployments

Performance Considerations

  • Modular starters: Smaller JARs and faster startup with technology-specific starters
  • Spring Framework 7: Performance improvements in core framework
  • Jackson 3: Improved JSON processing performance
  • Virtual threads: Consider enabling with Java 21+ (spring.threads.virtual.enabled=true)

Resources


Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning22d3 checks · Risk SAFE
  • Gen Agent Trust Hub22d

    The skill provides a legitimate and well-documented workflow for migrating Spring Boot applications from version 3.x to 4.0. It includes comprehensive references for dependency changes, property renames, and framework updates. No malicious patterns were detected.

  • Socket22d

    No alerts

  • Snyk22d

    Risk: MEDIUM · 1 issue

Signed by skilld at f10fdb8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated last month

README badge

README badge for github/awesome-copilot/spring-boot-4-migration