spring-boot icon indicating copy to clipboard operation
spring-boot copied to clipboard

Remove spring.factories auto-configuration support

Open philwebb opened this issue 3 years ago • 4 comments

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

philwebb avatar Feb 09 '22 18:02 philwebb

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.

snicoll avatar Mar 18 '22 17:03 snicoll

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.

kdebski85 avatar Jun 24 '22 07:06 kdebski85

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.

wilkinsona avatar Jun 24 '22 07:06 wilkinsona

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

wilkinsona avatar Jul 19 '22 19:07 wilkinsona