I've got question about resolving environment variables in shared files of config server. My current setup is pretty minimal :
src/main/resources/shared/application.yml :
application: version: 0.0.1-early test: ${JAVA_HOME}
src/main/resources/application.properties :
spring.profiles.active=native spring.cloud.config.server.native.searchLocations=classpath:/shared
Using gradle with :
- spring-boot-gradle-plugin:2.0.0.RELEASE
- spring-cloud-dependencies:Camden.SR7
- And then of course compile 'org.springframework.cloud:spring-cloud-config-server' in deps
Problem : GET http://localhost:8888/apptest/application gives me :
{
"name": "apptest",
"profiles": [
"application"
],
"label": null,
"version": null,
"state": null,
"propertySources": [
{
"name": "classpath:/shared/application.yml",
"source": {
"application.version": "0.0.1-early",
"application.test": "${JAVA_HOME}"
}
}
]
}
So env variable is not resolved. Same thing is with :
- http://localhost:8888/apptest/application?resolvePlaceholders=true
- http://localhost:8888/lab/apptest-application.properties?resolvePlaceholders=true
- http://localhost:8888/lab/apptest-application.properties?resolvePlaceholders=false
- http://localhost:8888/apptest-application.properties?resolvePlaceholders=true
I've looked at Spring cloud config server. Environment variables in properties but solution didn't help me + there where few new versions since then. So I'm opening new question.