Skip to content

Bug with AutoConfigure using spring.factories in SpringBoot 3 #33413

@zromano

Description

@zromano

Hi team, I started looking into upgrading to SpringBoot 3 and I think I may have stumbled upon a bug.

We have a library that uses spring.factories to make Spring automatically recognize a configuration class in a library. After upgrading to SpringBoot 3, the application using the library will no longer recognize configuration class and use it to create beans.

To make things easier, I made two simple apps that repro the issue and show that it will autoconfigure and create a bean on SpringBoot 2.7.5 and it will not on SpringBoot 3. You can just run the SpringBootTest in either repo to see the issue.

Also worth noting, if you add @ComponentScan("com.lib") to DemoApplication.java in the SpringBoot 3.0.0 example it will work again, but we shouldn't need to add that since we have the spring.factories in the lib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions