Hi i have a library which has class B with injected Property. Property is defined in application.yml file in resources section of library. library is packaged as Jar.
Class is something like this
@Configuration
class ClassB(
@Value("\${library.config.key}") private val key: String
) {
//Test code
}
Now i have springBoot application class with name ClassA which depends on classB. This application has its own yml file but property is not repeated here as it is already declared in library config.
@Configuration
class ClassA(
@Autowired val classB: ClassB
) {
//Test code
}
Now app started, it fails to initialise application with error
"Could not resolve placeholder 'library.config.key' "
In the spring boot app, i have added annotation to scan all components with common package prefix name
@SpringBootApplication
@ComponentScan("com.package")
class BhadraExplorerServiceApplication {
}
all code including dependent library code comes under package com.package
Can someone guide what is missing configuration here
UPDATE I am not sure if there is a bug in framework. If i make B's configuration as properties file instead of yml file, it is loading properly.