我看不到使用 spring cloud config 和 git 的属性/值 [英] I cannot see the properties/values using spring cloud config and git

查看:34
本文介绍了我看不到使用 spring cloud config 和 git 的属性/值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

I run the project and when i point my browser to 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

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

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

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

谢谢

推荐答案

我在 Ubuntu 中运行了 config-server,一切都按预期工作.这一定是仅在 Windows 中的问题.我在 Ubuntu 中得到的输出如下:

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

这篇关于我看不到使用 spring cloud config 和 git 的属性/值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆