I cannot see the properties/values using spring cloud config and git

人盡茶涼 提交于 2019-12-25 14:05:18

问题


I am using the sample project https://github.com/spring-cloud-samples/configserver

I run the project and when i point my browser to http://localhost:8888/foo/development/

I get the following values

{
"name": "foo",
"profiles": [
"development"
],
"label": "master",
"propertySources": [
{
"name": "overrides",
"source": {
"eureka.instance.nonSecurePort": "${CF_INSTANCE_PORT:${PORT:${server.port:8080}}}",
"eureka.instance.hostname": "${CF_INSTANCE_IP:localhost}",
"eureka.client.serviceUrl.defaultZone": "http://localhost:8761/eureka/"
}
}
]
}

But i do not get the values in the file foo-development.properties in https://github.com/spring-cloud-samples/config-repo

I am new to spring-cloud config. Could somebody point in the right direction to the values of the property file ?

Thank you


回答1:


I ran the config-server in Ubuntu and everything works there as expected. This must be a problem in windows only. The output I get in Ubuntu is the following:

{
"name": "foo",
"profiles": [
"development"
],
"label": "master",
"propertySources": [
{
"name": "overrides",
"source": {
"eureka.instance.nonSecurePort": "${CF_INSTANCE_PORT:${PORT:${server.port:8080}}}",
"eureka.instance.hostname": "${CF_INSTANCE_IP:localhost}",
"eureka.client.serviceUrl.defaultZone": "http://localhost:8761/eureka/"
}
},
{
"name": "https://github.com/spring-cloud-samples/config-repo/foo-development.properties",
"source": {
"bar": "spam"
}
},
{
"name": "https://github.com/spring-cloud-samples/config-repo/foo.properties",
"source": {
"foo": "bar"
}
},
{
"name": "https://github.com/spring-cloud-samples/config-repo/application.yml",
"source": {
"info.description": "Spring Cloud Samples",
"info.url": "https://github.com/spring-cloud-samples",
"eureka.client.serviceUrl.defaultZone": "http://user:${eureka.password:}@localhost:8761/eureka/",
"invalid.eureka.password": "<n/a>"
}
}
]
}


来源:https://stackoverflow.com/questions/29922871/i-cannot-see-the-properties-values-using-spring-cloud-config-and-git

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!