In spring boot 3, how do I define a custom configuration that is also @Component annotated? When I define a data class with the configurarion properties;
@Component
@ConfigurationProperties("testconfig")
data class TestConfiguration(var eyes: String, var nose: String)
I can see the property in the
application.properties
file but, in the repository where I want to use this component, I see an error
"could not autowire"
, and when I run the app it crashes because it couldn’t find
TestConfiguration
, how do I fix this please?