spring-projects/spring-boot

Remove spring.factories auto-configuration support

philwebb opened this issue · 4 comments

When #29698 has been finished in 2.7.x we should fully remove spring.factories support in 3.0.x

We've discussed this one today and concluded that it would be better if we wait for a release that contains the @AutoConfiguration change so that the community have a chance to adapt their starter before we remove support in 3.0.

Given the timeline for 2.7, we are considering this in Spring Boot 3.0.0-M4.

I am using 2.7, and I read that spring.factories is deprecated, and it will be removed.

My spring.factories contains only one line:
org.springframework.boot.env.EnvironmentPostProcessor=com.myorg.PropertySourceEnvironmentPostProcessor

com.myorg.PropertySourceEnvironmentPostProcessor class implements org.springframework.boot.env.EnvironmentPostProcessor and it does not have any annotation.

It is not clear to me if @AutoConfiguration annotation also supports EnvironmentPostProcessor.
Environment post processor must run before starting application context.
Maybe documentation should be expanded how to use custom environment post processor in Spring Boot 3.

I read that spring.factories is deprecated, and it will be removed.

spring.factories is not deprecated and isn't going to be removed. Where did you read that?

Maybe documentation should be expanded how to use custom environment post processor in Spring Boot 3.

The change that we've made only affects auto-configuration classes. All other entries in spring.factories, including environment post-processors, are unaffected so there is nothing more to document.

As agreed with @spencergibb, these changes should not be made until the week beginning 12 September.