Spring Boot 3.0, released on November 24, 2022, changes how it finds the automatic configuration supplied by shared libraries. Its default discovery code no longer reads those configuration names from META-INF/spring.factories. Enterprise teams maintaining internal starters need to check the registration file shipped inside each library, not just the Java classes. A class can still be packaged in the library without being discovered through the old registration route. [S1][S4][S5][S6]

The replacement is META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports. Spring’s version 3.0.0 guide says this file belongs inside the published JAR and lists configuration classes one per line; comments begin with #. A starter supplies dependencies and configuration for a library so that applications can adopt it with less setup. For its maintainer, the immediate task is to put the configuration class names in that resource and check the built archive contains it. A source-tree change alone does not verify what an application receives. [S6]

Spring Boot 2.7.0 already reads the imports file alongside the older registration. Its AutoConfigurationImportSelector combines entries loaded for EnableAutoConfiguration through SpringFactoriesLoader with entries from the imports mechanism. In 3.0.0, the corresponding method uses only ImportCandidates for AutoConfiguration. The compatibility change concerns discovery; it does not establish that every affected application will crash at startup. The consequence depends on what configuration the application needs and whether it loads it another way. [S4][S5][S6]

Do not treat that change as an instruction to delete every spring.factories entry. The 3.0.0 selector still uses SpringFactoriesLoader for AutoConfigurationImportFilter and AutoConfigurationImportListener. Those extension roles are separate from the list of configuration candidates. The migration target is the old automatic-configuration registration, not every factory registration in the archive. [S4][S5]

A focused configuration test can miss a packaging problem. Spring’s guide recommends ApplicationContextRunner for combinations of user configuration, environment settings and available libraries. Its runner example explicitly invokes a named auto-configuration. That checks the configuration’s behavior, but does not establish that normal application discovery can find it in a packaged dependency. For migration testing, also run a consuming application against the built starter and check that the expected configuration is discovered without a manual import. [S5][S6]

Being discovered does not guarantee activation. Spring documents conditions for relevant classes and missing user-defined beans, so a registered configuration need not activate in every application. Its guide also says auto-configurations should be loaded through the imports file, not picked up through component scanning. Widening an application’s scan is not a substitute for fixing the starter’s registration file. [S6]

Source documents

  1. Spring Boot 3.0 Goes GAhttps://spring.io/blog/2022/11/24/spring-boot-3-0-goes-ga
  2. Spring Boot v2.7.0 AutoConfigurationImportSelector.javahttps://raw.githubusercontent.com/spring-projects/spring-boot/v2.7.0/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java
  3. Spring Boot v3.0.0 AutoConfigurationImportSelector.javahttps://raw.githubusercontent.com/spring-projects/spring-boot/v3.0.0/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java
  4. Spring Boot v3.0.0: Creating Your Own Auto-configurationhttps://raw.githubusercontent.com/spring-projects/spring-boot/v3.0.0/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/developing-auto-configuration.adoc