I know you use @Configuration when you want to add @Bean for ApplicationContext. But why do you need to specify @Configuration when you want to use @PropertySource in Spring Boot?
I know you use @Configuration when you want to add @Bean for ApplicationContext. But why do you need to specify @Configuration when you want to use @PropertySource in Spring Boot?
From the API documentaion of @PropertySource:
Annotation providing a convenient and declarative mechanism for adding a
PropertySourceto Spring's Environment. To be used in conjunction with@Configurationclasses.
So, it can be deduced that Spring will register a org.springframework.core.env.PropertySource bean if we use @PropertySource which will be managed by the Spring container. And @Configuation is needed for declaring Spring beans.