Spring boot Spring云配置服务器未加载属性文件
我正在尝试使用这个示例spring cloud config server应用程序,但它在我本地的“windows 7”计算机中无法正常工作 当我尝试访问时,得到的结果如下,没有任何属性Spring boot Spring云配置服务器未加载属性文件,spring-boot,spring-cloud,Spring Boot,Spring Cloud,我正在尝试使用这个示例spring cloud config server应用程序,但它在我本地的“windows 7”计算机中无法正常工作 当我尝试访问时,得到的结果如下,没有任何属性 { "name": "foo", "profiles": [ "development" ], "label": "master", "propertySources": [ ] } 下面是一些与属性文件加载相关的日志 2015-04-13 17:46:03.381调试668
{
"name": "foo",
"profiles": [
"development"
],
"label": "master",
"propertySources": [
]
}
下面是一些与属性文件加载相关的日志
2015-04-13 17:46:03.381调试6684---[nio-8888-exec-1]o.s.c.c.s.NativeEnvironment存储库:未添加属性源:文件:/c:/Users/sekhap/git/configserver/target/config/foo development.properties2015-04-13 17:46:03.382调试6684---[nio-8888-exec-1]o.s.c.c.s.NativeEnvironment存储库:未添加属性源:文件:/c:/Users/sekhap/git/configserver/target/config/foo.properties
2015-04-13 17:46:03.382调试6684---[nio-8888-exec-1]o.s.c.c.s.NativeEnvironment存储库:未添加属性源:文件:/c:/Users/sekhap/git/configserver/target/config/application.yml
为什么不加载属性?是否与Windows环境有关,并且因为C:前面的“/” 这是当前发布版本(1.0.1.RELEASE)中的一个bug,已在当前快照(1.0.2.BUILD-snapshot)中修复
检查是否应该包含配置的代码没有规范化文件路径,因此在Windows上运行时失败,因为文件路径有Windows分隔符(\),而它所比较的路径有linux分隔符(“/”)。我在Ubuntu中运行了配置服务器,一切正常。这一定是windows中的问题。在windows中也存在同样的问题,但在linux中运行时工作正常