I have a Spring Boot application.
I am including multiple dependencies, which have different PropertySourcesPlaceholderConfigurer
configured.
One PropertySourcesPlaceholderConfigurer
is reading Properties from a custom .properties
file with a prefix like myResolver
.
The file looks like this:
property.one=apple
property.two=${property.one}tree
I can inject both properties with $myResolver{property.one}
correctly into my code.
However, when injecting $myResolver{property.two}
, it gets injected as ${property.one}tree
. ${property.one}
is not resolved to apple
.
How can I make Spring resolve nested properties inside properties files?
It seems that I need to write property.two=$myResolver{property.one}tree
to resolve the nested property.
The prefix is important.