根本沒有使用任何Git倉庫,可以使用Spring Cloud Config嗎?我試圖用本地目錄與這application.properties測試:在不使用Git倉庫的情況下使用Spring Cloud Config
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?
UPDATE:
由於斯賓塞的建議,我增加了以下內容:
spring.profiles.active=native spring.cloud.config.server.native.searchLocations=${user.dir}/src/main/resources/configs
而且我有一個文件 「bar.properties」 內部 「CONFIGS」 具有以下內容:
foo: bar
但我得到的迴應是不讀取文件:
{
"name": "bar",
"profiles": [
"default"
],
"label": "master",
"propertySources": []
}
我使用的URL是http://localhost:8888/bar/default
我失去了什麼東西?提前再次感謝!
謝謝,成功了! – Turar