I define my custom yml file(something not named application.yml) on my SpringBoot project.
Here's my code.
@Component
@PropertySource("classpath:/custom.yml")
public class CustomConfig {
@Value("${test.name}")
private String testName;
}
//custom.yml
//binding failed set as null
test:
name: hello
//binding success
test.name: hello
At first, I tried to use @configurationproperties.
But it's not working, and then I tried to test on @Value.
Now I found that it fail binding when yml file is in hierarchy structure.
Any ideas to solve this problem?
I want to set my custom,yml in hierarchy structure.(including list data) Please help me!