Using spring.factories to find auto-configuration classes is causing problems with our native work. We initially used it because the code was already available, but we want to offer an alternative in 2.7 and stop using spring.factories for auto-configuration in 3.0.

The following required tasks have been identified:

  • [ ] Design and document a file format that can replace spring.factories for auto-configuration.
  • [ ] Update the existing import to use both spring.factories and the new entries.
  • [ ] Introduce a new @AutoConfiguration annotation which is meta-annotated with @Configuration. The new annotation will default proxyBeanMethods to false.
  • [ ] Document the changes in the reference docs and provide a wiki migration guide
  • [ ] Update documentation tooling in buildSrc to read the new file
  • [ ] Check with existing IDE and tool vendors to ensure the new format doesn't cause issues

The following nice-to-have tasks have been identified:

  • [ ] Develop a migration tool to convert our existing codebase (a tool will be valuable for other project, but we might also be able to use sed)
  • [ ] Update our annotation processor so the the new auto-configuration file can be auto-generated

We will need to retain spring.factories support for the life of 2.x because Spring Cloud will not be able to migrate to a new system (since it supports 2.6)

Comment From: wilkinsona

Due to @ImportAutoConfiguration support being implemented as a sub-class of AutoConfigurationImportSelector, I think we'll have to tackle it at the same time as working on this. I imagine we'll end up with another file for ImportAutoConfiguration classes. It can use the same format as the new file for AutoConfiguration.

Comment From: mhalbritter

Closed in favour of:

  • https://github.com/spring-projects/spring-boot/issues/29870
  • https://github.com/spring-projects/spring-boot/issues/29871
  • https://github.com/spring-projects/spring-boot/issues/29872
  • https://github.com/spring-projects/spring-boot/issues/29873

Comment From: haydin505

Hi @philwebb,

Can you explain the idea of setting proxyBeanMethods to false? I'm planing to use @AutoConfiguration but I want to proxy beans with CGLIB too. Can you give advice on the subject?

Comment From: wilkinsona

@haydin505 I see you also asked this on Stack Overflow where someone is already trying to help you. Please don't ask the same question in multiple places at the same time as it just wastes people's time.

Comment From: haydin505

@wilkinsona I have researched the issue, traced design and development, then I asked direct question to the author of the issue. In other words, here I’m trying to gather information from the creator. On the other hand, in Stack Overflow I created a thread to discuss and realize new perspective. Hence, they are not duplicate, both questions has their own meaning. Thank for the feedback though.

Comment From: philwebb

@haydin505 It's quite time consuming for us when people ask questions here and we specifically ask people not to do it. It's worse when there is a question on stackoverflow.com and not even a reference to it since we may expend effort here when someone else is already helping.

Comment From: haydin505

@philwebb Sorry for the inconvenience. For later cases I will only create questions on Stack Overflow and not ask anything on GitHub.

Comment From: philwebb

Thanks @haydin505! FWIW I posted an answer that I hope helps.