I am working with Java and spring boot apps. I have a property file which needs to be added as environmental variables for a docker image at run time. Some of the properties are filtered through the existing Environment when they are used via placeholders as below.
app.name=MyApp
app.description=${app.name} is a Spring Boot application
I am writing a sample java file to read this property file and create a map object with some filtered properties. In this process how can I replace the placeholders with the actual property values?
I have tried looking for a key and replacing using getProperty method. But I would like to avoid looking up hard coded property key names in order to avoid maintenance difficulties.
Thanks in advance.