Migration
Spring Boot 3 Migration- Migrate Spring Boot 2 To Spring Boot 3
· STEPS :
- Change the spring boot version:In build.gradal.kt
id("org.springframework.boot")version "2.7.18" >> id("org.springframework.boot") version "3.1.5"
id("io.spring.dependency-management") version "1.0.15.RELEASE" >> id("io.spring.dependency-management") version "1.1.3"
- Add single swagger dependency
implementation ("org.springdoc:springdoc-openapi-starter-webflux-ui:2.2.0")
· Remove swagger dependency
implementation ("org.springdoc:springdoc-openapi-ui:1.6.15")
implementation ("org.springdoc:springdoc-openapi-kotlin:1.6.15")
implementation ("org.springdoc:springdoc-openapi-webmvc-core:1.6.15")
implementation ("org.springdoc:springdoc-openapi-webflux-ui:1.6.15")
implementation ("org.springdoc:springdoc-openapi-hateoas:1.6.15")
implementation ("org.springdoc:springdoc-openapi-data-rest:1.6.15")
implementation ("org.springdoc:springdoc-openapi-security:1.6.15")
implementation ("org.springdoc:springdoc-openapi-native:1.6.15")
implementation ("org.springdoc:springdoc-openapi-javadoc:1.6.15")
implementation("org.jlleitschuh.gradle:ktlint-gradle")
- Add Migration dependency
implementation ("org.springframework.boot:spring-boot-properties-migrator")
Note: Once you have completed your migration, please remove this dependency from the ‘pom.xml’.
- Add library
implementation ("commons-io:commons-io:2.11.0") >> implementation("commons-io:commons-io:2.13.0")
implementation ("com.google.code.gson:gson:2.10.1")
implementation ("io.jsonwebtoken:jjwt:0.12.3")
implementation ("org.apache.commons:commons-text:1.11.0")
implementation ("com.squareup.okhttp3:okhttp:4.12.0")
implementation ("com.github.lookfirst:sardine:5.12")
{exclude(group = "org.slf4j", module = "slf4j-simple")}
· Change library version
implementation("com.google.code.gson:gson:2.10") >> implementation("com.google.code.gson:gson:2.10.1")
implementation("io.jsonwebtoken:jjwt:0.9.1") >> implementation("io.jsonwebtoken:jjwt:0.12.3")
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17">>jvmTarget = "17"
}
}
- Update packages starting from ‘javax’ to ‘jakarta’ in HealthTrackerServerApplication.kt
- Change in SecurityConfig.kt
- Change in RedisConfig.kt
- Change in notificationConfig.kt
- Change in jwtUtils.kt
- Change in CustomSecurityContextRepository.kt
- Change in JwtTokenProvider.kt
- Change in jwtAuthenticationFilter.kt
- Change in User.kt
- Change in UserPrincipal.kt
- Change in UserPrincipleReactiveService.kt