Spring Boot 4 Migration Guide
Migrate Lodsve Boot application to Spring Boot 4.1.2.
Lodsve Boot currently only maintains Spring Boot 4 lines, and the target version is 4.1.2. Spring Initializr appears as 4.1.2.RELEASE, Maven parent and Gradle plugin use 4.1.2.
Migration Checklist
- Switch your JDK, Maven or Gradle build environment to JDK 21.
- Change the
javax.servlet,javax.persistence,javax.annotationandjavax.validationimports to the correspondingjakarta.*packages.javax.sqlandjavax.scriptbelong to Java SE and do not need to be renamed. - Remove Springfox and
io.swagger.annotationsand use Springdoc OpenAPI 3 annotations provided bylodsve-boot-starter-swagger, such as@Tag,@Operation,@Parameterand@Schema. - Check for custom auto-configuration. Boot 4 uses
META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.importsto register the autoconfiguration class. - Recheck version combinations of Spring Cloud, Nacos, MyBatis, Druid and RocketMQ and perform dependency tree checks.
Current compatibility notes
Lodsve Boot 4 retains the Druid data source connection pooling capability, but the monitoring Servlet and Web Filter of Druid 1.2.28 are still based on javax.servlet, so Boot 4 automatic configuration will not register the Druid monitoring page and Web statistics filter. Please use Actuator or deploy a Jakarta-compatible monitoring component separately; wait until Druid provides the Jakarta version before resuming registration.
Maven example
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>4.1.2</version>
</parent>
When using Lodsve Boot, com.lodsve.boot:lodsve-boot-dependencies is preferred as the parent POM, which will uniformly manage Starter and third-party dependencies.
Verify
./mvnw clean verify
./mvnw spring-boot:run
Confirm that the application can start, auto-configuration conditions take effect, and access the Swagger UI and Actuator endpoint. Boot 2/3 applications cannot directly reuse the old javax.* dependencies and Springfox configuration; please upgrade the business code after the migration is completed.
