我无法使用spring cloud config和git

时间:2015-04-28 15:00:29

标签: spring-cloud

我正在使用示例项目 https://github.com/spring-cloud-samples/configserver

我运行项目,当我指向浏览器时 http://localhost:8888/foo/development/

我得到以下值

{
"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/"
}
}
]
}

但我没有得到文件foo-development.properties中的值 https://github.com/spring-cloud-samples/config-repo

我是spring-cloud配置的新手。有人可以指向属性文件值的正确方向吗?

谢谢

1 个答案:

答案 0 :(得分:0)

我在Ubuntu中运行了配置服务器,一切都按预期工作。这只是Windows中的一个问题。我在Ubuntu中得到的输出如下:

{
"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>"
}
}
]
}
相关问题