i have a jar file which has below class to load some properties -
@ConfigurationProperties(prefix = "common-list")
@Configuration
@Component
public class CommonConfig{
...
}
In my spring boot project, above class/jar is a dependency.
How do i specify where to look for this property "common-list" to load in my project?
OR
Do i need to modify the class/jar, with PropertySource annotation specifying the property file where to look for these common-list values?
I have bootstrap.properties with following line-
spring.application.name=xyz
xyz.yaml on the config server
common-list:
...
and by looking at env properties of my spring boot application, i can see the file is picked up and loaded. But CommonConfig instance doesnt get initialized with those files values.
Values are organized correctly as i have tested them by building a spring boot test application in same project where jar is created (all the values populate in CommonConfig instances correctly).
UPDATED (SOLVED)
Issue was with converting my object to json string incorrectly, which caused the advice to go in default route instead of picking correct values.