Skip to content

Audit deprecated APIs and prepare removal roadmap for Spring Boot 4.0.0 #46042

Closed as duplicate of#45600
@WangzJi

Description

@WangzJi

Spring Boot has numerous deprecated APIs marked with @Deprecated(forRemoval = true) across different modules with varying deprecation timelines. Before the 4.0.0 release, we need a systematic audit to determine which APIs are ready for removal and which require extended deprecation.

Current State

Based on codebase analysis, deprecated APIs fall into categories by timeline:

Long-standing (candidates for removal):

  • Since 3.2.0: FlywayProperties, JmsProperties methods
  • Since 3.3.0: Actuator endpoint annotations (ControllerEndpoint, ServletEndpoint, etc.)

Recent (require evaluation):

  • Since 3.4.0: ApplicationResourceLoader constructors, RestTemplateBuilder methods
  • Since 3.5.0: LoggingSystemProperties, ThreadPoolTaskSchedulerBuilder

Distribution: ~60+ deprecated APIs across spring-boot-core, spring-boot-actuator, spring-boot-autoconfigure

Proposed Approach

  1. Inventory all @Deprecated(forRemoval = true) APIs

  2. Categorize by criteria:

    • Ready for removal: deprecated ≥2 versions, clear replacement exists
    • Requires planning: recently deprecated, complex migration
    • Keep deprecated: critical functionality, major ecosystem impact
  3. Implementation phases:

    • Phase 1: No-op methods and clear replacements
    • Phase 2: APIs with migration guides
    • Phase 3: Complex cases requiring extended deprecation

Examples

Ready for removal:

// SpringApplication.java - Empty method body
@Deprecated(since = "3.4.0", forRemoval = true)
protected void logStartupInfo(boolean isRoot) {}

// FlywayProperties.java - Clear replacement available
@Deprecated(since = "3.2.0", forRemoval = true)  
public String[] getLocations() { ... }

Requires evaluation:

// ApplicationResourceLoader.java - Recently deprecated, has replacement
@Deprecated(since = "3.4.0", forRemoval = true)
public ApplicationResourceLoader() {
    // Replacement: ApplicationResourceLoader.get()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions