Tur*_*rar 27 java spring spring-cloud spring-cloud-config
是否可以在不使用任何Git仓库的情况下使用Spring Cloud Config?我正在尝试使用application.properties中的本地目录来测试它:
spring.cloud.config.server.git.uri=file://${user.dir}/src/main/resources/config-repo
但是我收到以下错误:
java.lang.IllegalStateException:文件中没有.git:// path/to/src/main/resources/config-repo
如果一个人根本不使用Git,那么就不可能使用Spring Cloud吗?
更新:
感谢Spencer的建议,我补充了以下内容:
spring.profiles.active=native
spring.cloud.config.server.native.searchLocations=${user.dir}/src/main/resources/configs
我在"configs"中有一个文件"bar.properties",其中包含以下内容:
foo: bar
Run Code Online (Sandbox Code Playgroud)
但我得到的反应不是读取文件:
{
"name": "bar",
"profiles": [
"default"
],
"label": "master",
"propertySources": []
}
Run Code Online (Sandbox Code Playgroud)
我正在使用的URL是http:// localhost:8888/bar/default
我错过了别的什么吗?再次感谢您!
小智 8
对于Windows,我像这样使用它:
spring.cloud.config.server.git.uri=C:\\\\Users\\\\my.user\\\\Desktop\\\\config\\\\
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19078 次 |
| 最近记录: |