I want to launch my program with java ... -Denv=prod ...
and have
@PropertySource("classpath:/settings/$idontknowwhat$/database.properties")`
read properties file: /settings/prod/database.properties
I have tried using #{systemProperties['env']}
but it is not resolved with exception:
Could not open ServletContext resource ['classpath:/settings/#{systemProperties['env']}/database.properties]
Found it, I can simply use
@PropertySource("classpath:/settings/${env}/database.properties")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With