A @ConfigurationProperties annotated class doesn't get autowired in other @ConfigurationProperties, which worked fine in Spring Boot 2.7.
Here is a simple demonstrator project: https://github.com/chkpnt/spring-boot-autowired-configuration-properties
It contains a branch 2.7 and a branch 3.2. The test is passing with Spring Boot 2.7 but failing with Spring Boot 3.2 (I've tested 3.0 and 3.1, too).
When you breakpoint the constructor of WebUIPropertiesImpl, you'll see, that the other configuration properties class is injected as null.
As I don't see anything related to this issue documented in the Migration Guide and the spring-boot-properties-migrator isn't reporting an issue, I guess this issue is a bug.
Comment From: wilkinsona
You need to use @Autowired to prevent the constructor being a target for property binding. This is mentioned in the reference docs:
To opt out of constructor binding for a class with a single parameterized constructor, the constructor must be annotated with
@Autowired
We overlooked it in the migration guide though. I've updated this section to correct that.
Comment From: chkpnt
You need to use
@Autowiredto prevent the constructor being a target for property binding.
Such a obvious solution 🫣, thanks for your quick reply! I can confirm it's working and I've obviously missed that part in the reference docs.