본문으로 건너뛰기

Spring Boot 4.0 주요 변경사항과 새로운 기능

  • Spring Boot 4.0이 2025년 11월에 출시되었다
  • Spring Framework 7.0을 기반으로 한다
  • Jakarta EE 11 완전 호환, 향상된 Kotlin 지원, 일급 API 버저닝을 포함한다
  • Spring Boot 4.0 was released in November 2025
  • Built on Spring Framework 7.0
  • Includes full Jakarta EE 11 compatibility, enhanced Kotlin support, and first-class API versioning

최소 요구사항

Spring Boot 4.0은 기준 요구사항을 상향한다:

구성요소최소 버전권장 버전
Java17 (LTS)25
Kotlin2.22.2.20+
Gradle8.14+9.x
Maven3.9+-

핵심 사항:

  • Java 17은 최소 버전으로 유지
  • Java 25 (2025년 9월)의 모든 기능 완전 지원
  • Kotlin 2.2 기준선과 K2 컴파일러 지원
  • GraalVM 24 네이티브 이미지 빌드 호환

Minimum Requirements

Spring Boot 4.0 raises the baseline requirements:

ComponentMinimum VersionRecommended Version
Java17 (LTS)25
Kotlin2.22.2.20+
Gradle8.14+9.x
Maven3.9+-

Key points:

  • Java 17 remains the minimum version
  • Full support for all Java 25 (September 2025) features
  • Kotlin 2.2 baseline with K2 compiler support
  • GraalVM 24 native image build compatibility

주요 의존성 업그레이드

Spring 포트폴리오

의존성버전
Spring Framework7.0
Spring Security7.0
Spring Data2025.1
Spring Session4.0
Spring Batch6.0

서드파티 라이브러리

라이브러리버전
Hibernate7.1
Jackson3.0
Tomcat11.0
MongoDB Driver5.6.0

Jakarta EE 11 호환

  • Jakarta Servlet 6.1 - 최신 웹 API 지원
  • Jakarta Persistence 3.2 - 향상된 JPA 기능
  • Jakarta Validation 3.1 - 업데이트된 Bean Validation

참고: Undertow는 Servlet 6.1과 아직 호환되지 않아 지원되지 않는다. Tomcat 또는 Jetty를 사용해야 한다.

Major Dependency Upgrades

Spring Portfolio

DependencyVersion
Spring Framework7.0
Spring Security7.0
Spring Data2025.1
Spring Session4.0
Spring Batch6.0

Third-Party Libraries

LibraryVersion
Hibernate7.1
Jackson3.0
Tomcat11.0
MongoDB Driver5.6.0

Jakarta EE 11 Compatibility

  • Jakarta Servlet 6.1 - Latest web API support
  • Jakarta Persistence 3.2 - Enhanced JPA features
  • Jakarta Validation 3.1 - Updated Bean Validation

Note: Undertow is not supported as it is not yet compatible with Servlet 6.1. Use Tomcat or Jetty instead.

새로운 기능

HTTP Service Client

Spring Boot 4.0은 선언적 HTTP 클라이언트를 일급으로 지원한다

인터페이스를 정의하고 어노테이션을 붙이면 Spring이 런타임에 구현체를 생성한다

New Features

HTTP Service Client

Spring Boot 4.0 provides first-class support for declarative HTTP clients

Define an interface with annotations and Spring generates the implementation at runtime

@HttpExchange("/api/users")
public interface UserClient {

@GetExchange("/{id}")
User getUser(@PathVariable("id") Long id);

@GetExchange
List<User> getAllUsers();

@PostExchange
User createUser(@RequestBody User user);

@DeleteExchange("/{id}")
void deleteUser(@PathVariable("id") Long id);
}

@ImportHttpServices를 사용하여 클라이언트를 구성한다:

Configure the client using @ImportHttpServices:

@Configuration
@ImportHttpServices(group = "user-service", types = UserClient.class)
public class HttpClientConfig {

@Bean
public RestClientHttpServiceGroupConfigurer configurer() {
return groups -> groups
.filterByName("user-service")
.forEachClient((group, builder) -> {
builder.baseUrl("https://api.example.com");
builder.defaultHeader("Accept", "application/json");
});
}
}

클라이언트 주입하여 사용:

Inject and use the client:

@Service
@RequiredArgsConstructor
public class UserService {

private final UserClient userClient;

public User findUser(Long id) {
return userClient.getUser(id);
}
}

장점:

  • 추가 의존성 불필요 (spring-web에 포함)
  • Virtual Thread 지원으로 효율적인 블로킹 작업
  • 많은 경우 OpenFeign을 대체 가능

API 버저닝

Spring Boot 4.0은 내장 API 버저닝 지원을 도입한다

application.yml로 구성:

Benefits:

  • No additional dependencies required (included in spring-web)
  • Efficient blocking operations with Virtual Thread support
  • Can replace OpenFeign in many cases

API Versioning

Spring Boot 4.0 introduces built-in API versioning support

Configure with application.yml:

spring:
mvc:
apiversion:
supported: 1.0, 2.0, 3.0
default: 1.0
use:
# 전략 중 하나 선택:
# Path segment: /api/v1/users
path-segment: 1
# 또는 Header: X-API-Version: 1.0
# header: X-API-Version
# 또는 Query param: ?version=1.0
# query-parameter: version

컨트롤러에서 버저닝 사용:

Use versioning in controllers:

@RestController
@RequestMapping("/api/users")
public class UserController {

// ko: v1.0에서만 사용 가능 | en: Available only in v1.0
@GetExchange(value = "/{id}", version = "1.0")
public UserV1Response getUserV1(@PathVariable Long id) {
return userService.getUserV1(id);
}

// ko: v2.0 이상에서 사용 가능 | en: Available in v2.0 and above
@GetExchange(value = "/{id}", version = "2.0+")
public UserV2Response getUserV2(@PathVariable Long id) {
return userService.getUserV2(id);
}
}

OpenTelemetry Starter

새로운 spring-boot-starter-opentelemetry 모듈로 관측성 설정을 간소화한다:

OpenTelemetry Starter

The new spring-boot-starter-opentelemetry module simplifies observability setup:

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-opentelemetry'
}
management:
opentelemetry:
tracing:
export:
otlp:
enabled: true
endpoint: http://localhost:4317

JmsClient 지원

Spring Boot 4.0은 JmsTemplate의 현대적 대안으로 JmsClient를 도입한다:

JmsClient Support

Spring Boot 4.0 introduces JmsClient as a modern alternative to JmsTemplate:

@Service
@RequiredArgsConstructor
public class MessageService {

private final JmsClient jmsClient;

public void sendMessage(String destination, OrderEvent event) {
jmsClient.send(destination, event);
}

public OrderEvent receiveMessage(String destination) {
return jmsClient.receive(destination, OrderEvent.class);
}
}

Virtual Threading 지원

Java 21+ 실행 시 가상 스레드가 완전 지원된다:

Virtual Threading Support

Virtual threads are fully supported when running on Java 21+:

spring:
threads:
virtual:
enabled: true

리액티브 프로그래밍의 복잡성 없이 효율적인 블로킹 I/O 작업 처리가 가능하다

Enables efficient blocking I/O operation handling without the complexity of reactive programming

Kotlin 지원 개선

Kotlin 2.2 기준선과 K2 컴파일러

Spring Boot 4.0은 Kotlin 2.2+를 요구하며, 다음을 포함한다:

  • K2 컴파일러로 더 빠른 컴파일
  • 향상된 코드 분석
  • 더 나은 IDE 지원

JSpecify Null-Safety

JSpecify 어노테이션은 Spring 포트폴리오 전반에 걸쳐 표준화된 null-safety를 제공한다

Kotlin 2.x는 이를 자동으로 Kotlin nullability로 변환한다:

Kotlin Support Improvements

Kotlin 2.2 Baseline and K2 Compiler

Spring Boot 4.0 requires Kotlin 2.2+, which includes:

  • Faster compilation with K2 compiler
  • Enhanced code analysis
  • Better IDE support

JSpecify Null-Safety

JSpecify annotations provide standardized null-safety across the entire Spring portfolio

Kotlin 2.x automatically converts these to Kotlin nullability:

// ko: Spring API가 이제 적절한 Kotlin nullability를 가짐
// en: Spring APIs now have proper Kotlin nullability
// ko: 더 이상 플랫폼 타입이 없음!
// en: No more platform types!
val user: User = userRepository.findById(id) // ko: User 반환, User!가 아님 | en: Returns User, not User!
val maybeUser: User? = userRepository.findByEmail(email) // Nullable

코루틴 컨텍스트 전파

코루틴에서 관측성을 위한 자동 컨텍스트 전파:

Coroutine Context Propagation

Automatic context propagation for observability in coroutines:

spring:
reactor:
context-propagation: auto
@Service
class UserService(private val userRepository: UserRepository) {

// ko: 트레이싱 컨텍스트 자동 전파 | en: Tracing context automatically propagated
suspend fun findUser(id: Long): User {
return userRepository.findById(id)
}
}

Kotlin Serialization 모듈

kotlinx.serialization 지원을 위한 새로운 스타터:

Kotlin Serialization Module

New starter for kotlinx.serialization support:

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-kotlin-serialization'
}
@Serializable
data class User(
val id: Long,
val name: String,
val email: String
)

BeanRegistrarDsl

Kotlin DSL을 사용한 프로그래밍 방식의 빈 등록:

BeanRegistrarDsl

Programmatic bean registration using Kotlin DSL:

class MyBeanRegistrar : BeanRegistrarDsl({
// ko: 간단한 등록 | en: Simple registration
registerBean<UserRepository>()

// ko: 옵션과 함께 등록 | en: Registration with options
registerBean(
name = "customService",
prototype = true,
lazyInit = true
) {
CustomService(ref<UserRepository>())
}

// ko: 프로파일 별 등록 | en: Profile-specific registration
profile("production") {
registerBean { ProductionDataSource() }
}

profile("development") {
registerBean { DevelopmentDataSource() }
}
})

구성 변경사항

이름이 변경된 속성

이전 속성새 속성
management.tracing.enabledmanagement.tracing.export.enabled
spring.dao.exceptiontranslation.enabledspring.persistence.exceptiontranslation.enabled

새로운 속성

속성기본값설명
logging.console.enabledtrue콘솔 로깅 활성화/비활성화
management.tracing.export.enabledtrue트레이싱 익스포트 활성화
spring.threads.virtual.enabledfalse가상 스레드 활성화

예시 구성

Configuration Changes

Renamed Properties

Old PropertyNew Property
management.tracing.enabledmanagement.tracing.export.enabled
spring.dao.exceptiontranslation.enabledspring.persistence.exceptiontranslation.enabled

New Properties

PropertyDefaultDescription
logging.console.enabledtrueEnable/disable console logging
management.tracing.export.enabledtrueEnable tracing export
spring.threads.virtual.enabledfalseEnable virtual threads

Example Configuration

spring:
threads:
virtual:
enabled: true
persistence:
exceptiontranslation:
enabled: true

management:
tracing:
export:
enabled: true

logging:
console:
enabled: true
level:
root: INFO
com.example: DEBUG

마이그레이션 가이드

업그레이드 경로

  1. 이전 버전이라면 먼저 Spring Boot 3.5로 업그레이드
  2. Java 버전을 17 이상으로 업데이트 (25 권장)
  3. Kotlin 사용 시 Kotlin 버전을 2.2+로 업데이트
  4. Gradle을 8.14+ 또는 9.x로 업데이트
  5. OpenRewrite 마이그레이션 레시피 실행

Migration Guide

Upgrade Path

  1. If on an earlier version, upgrade to Spring Boot 3.5 first
  2. Update Java version to 17 or higher (25 recommended)
  3. If using Kotlin, update Kotlin version to 2.2+
  4. Update Gradle to 8.14+ or 9.x
  5. Run OpenRewrite migration recipes
plugins {
id 'org.openrewrite.rewrite' version '7.x.x'
}

dependencies {
rewrite 'org.openrewrite.recipe:rewrite-spring:latest.release'
}

// 실행: gradle rewriteRun

주요 변경사항

  1. JUnit 4 제거: JUnit Jupiter 6만 지원
  2. Undertow 미지원: Tomcat 또는 Jetty 사용
  3. RestTemplate 지원 중단 경고: RestClient가 권장 대안
  4. Hibernate 7.1 변경사항: 분리된 엔티티를 영속성 컨텍스트에 다시 연결할 수 없음
  5. Jackson 3.0: Jackson 2.x에서 일부 API 변경

속성 마이그레이션

application.yml에서 이 속성들을 업데이트:

Breaking Changes

  1. JUnit 4 Removed: Only JUnit Jupiter 6 is supported
  2. Undertow Not Supported: Use Tomcat or Jetty
  3. RestTemplate Deprecation Warning: RestClient is the recommended alternative
  4. Hibernate 7.1 Changes: Detached entities cannot be reattached to persistence context
  5. Jackson 3.0: Some API changes from Jackson 2.x

Property Migration

Update these properties in application.yml:

# ko: 이전 (Spring Boot 3.x) | en: Before (Spring Boot 3.x)
management:
tracing:
enabled: true
spring:
dao:
exceptiontranslation:
enabled: true

# ko: 이후 (Spring Boot 4.0) | en: After (Spring Boot 4.0)
management:
tracing:
export:
enabled: true
spring:
persistence:
exceptiontranslation:
enabled: true

지원 일정

버전OSS 지원 종료
Spring Boot 4.02026년 11월
Spring Boot 3.52026년 6월
Spring Framework 7.02026년 11월
Spring Framework 6.22026년 6월

결론

Spring Boot 4.0은 현대적인 Java와 Kotlin 개발을 위한 상당한 개선을 가져온다

핵심 사항:

  • 선언적 HTTP 클라이언트: OpenFeign 없이 인터페이스 기반 REST 클라이언트
  • 내장 API 버저닝: 간단한 설정으로 버전 관리
  • 향상된 Kotlin 지원: K2 컴파일러, JSpecify null-safety
  • Virtual Thread 지원: 리액티브 복잡성 없이 확장성 확보

프로덕션 마이그레이션의 경우, Spring Boot 3.5로 먼저 업그레이드하고, 애플리케이션을 검증한 후 4.0으로 진행하라

OpenRewrite 레시피를 사용하여 속성 및 API 마이그레이션을 자동화하라

Support Timeline

VersionOSS Support End
Spring Boot 4.0November 2026
Spring Boot 3.5June 2026
Spring Framework 7.0November 2026
Spring Framework 6.2June 2026

Conclusion

Spring Boot 4.0 brings significant improvements for modern Java and Kotlin development

Key takeaways:

  • Declarative HTTP Client: Interface-based REST client without OpenFeign
  • Built-in API Versioning: Version management with simple configuration
  • Enhanced Kotlin Support: K2 compiler, JSpecify null-safety
  • Virtual Thread Support: Scalability without reactive complexity

For production migration, upgrade to Spring Boot 3.5 first, validate your application, then proceed to 4.0

Use OpenRewrite recipes to automate property and API migration