Skip to content

refactor: consolidate starter auto-configuration - #810

Merged
huayanYu merged 1 commit into
baomidou:devfrom
MeenaHariharan-19:fix-starters-791
Oct 17, 2026
Merged

huayanYu merged 1 commit into
baomidou:devfrom
MeenaHariharan-19:fix-starters-791

Conversation

@MeenaHariharan-19

Copy link
Copy Markdown

Target Branch

dev

Change Type

  • Bugfix
  • Feature
  • Code style
  • Refactor
  • Build / CI
  • Doc
  • Other

Description

After the Seata checker moved into spring-boot-common, this change audits the remaining same-named classes across the Boot 2, 3, and 4 starters. It consolidates shared configuration to reduce duplication and keep the JaCoCo exclusion rationale accurate, while preserving the JDK 8 baseline and version-specific integrations.

  • Move shared AOP advisor configuration into spring-boot-common; each starter retains its servlet-specific DsProcessor chain.
  • Move the Java 8-compatible Boot 2/3 Hikari metrics configuration and binder into common.
  • Give Boot 4 a distinct metrics auto-configuration adapter for its relocated Boot APIs.
  • Add v1/v3/v4 tests asserting that each starter selects the correct servlet processor.
  • Document the audit and remaining JaCoCo bundle limitation in CONTRIBUTING.md and build.gradle.

Fixes #<issue-number>

Impact on Core Contracts

  • @DS resolution / context-holder stack semantics
  • Datasource creation and pool parameters
  • Transaction semantics
  • Groups and load balancing
  • Encryption / configuration properties
  • Build artifacts: shared auto-configuration moves to common; the Java 8 baseline is preserved. Hikari remains compileOnly.
  • None

Duplicate-Class Audit

Class Classification Disposition
DynamicDataSourceAopConfiguration Shared advisor logic; servlet processor chain differs Advisor config moved to common; each starter provides its processor chain
DynamicDataSourcePoolMetricsAutoConfiguration Boot 2/3 differ only in syntax; Boot 4 uses relocated APIs Boot 2/3 implementation moved to common; Boot 4 uses a distinct adapter
DsJakartaHeaderProcessor, DsJakartaSessionProcessor Source-identical in Boot 3/4, but tied to Jakarta servlet/Spring APIs Retained in Boot 3/4 starters
DynamicDataSourceAutoConfiguration Boot and Druid integration differs by version Retained per starter
DruidDynamicDataSourceConfiguration Boot 2/3 use different Druid package layouts; Boot 4 has no counterpart Retained in Boot 2/3

Self-Check

  • ./gradlew build jacocoRootReport passed; the common module and all three starter test suites were verified.
  • Added tests for starter-specific processor selection.
  • New Java files include the required license header.
  • No new third-party library was introduced. Common's Hikari dependency remains compileOnly; it now uses BOM-managed HikariCP because HikariCP-java7 2.4.x lacks the metrics tracker API used by the binder.
  • Considered GraalVM Native Image impact; no new reflection metadata was needed. nativeTest was not run locally.
  • Conventional commit: refactor: consolidate starter auto-configuration

Other Information

The remaining repeated starter classes are documented alongside the JaCoCo rationale. Keep the starter modules out of the single JaCoCo bundle unless their duplicate class names are handled.

@github-actions github-actions Bot added starters Spring Boot starter modules tests Test suites and fixtures documentation Docs and wiki ci CI, build and release labels Oct 16, 2026
@huayanYu
huayanYu merged commit fe5a819 into baomidou:dev Oct 17, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI, build and release documentation Docs and wiki starters Spring Boot starter modules tests Test suites and fixtures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants