我已经配置了与 Git 存储库集成的 Spring Boot Config 服务器(2.4.1 版本)。
配置看起来有效,从 git 加载文件期间没有问题,但是当我指向 localhost:port/application/dev 我得到
{"name":"application","profiles":["dev"],"label":null,"version":"7e67e69e075b05d9fa50e3255deef7585ed658c7","state":null,"propertySources":[]}
我打开了所有内容的记录,我发现配置服务器正确下载了文件并将文件保存在临时文件夹中的某个位置,例如:
(1) C:/Users/username/AppData/Local/Temp/config-repo-5493381163789847226/
但是 NativeEnironmentRepository 预计它将位于:
(2) C:\Users\username\AppData\Local\Temp\config-repo-5493381163789847226\
这也是有效的 Windows 路径。
当我打开调试器时,我发现 NativeEnvironmentRepository 检查路径(1)
反对模式(2),它失败了。所以结果
"propertySources":[]
是空的。
这是 SpringBoot 配置服务器上的错误吗?还是我应该设置/更改配置中的某些内容?看起来 NativeEnvironmentRepository 应该使用系统 File.separator ...