2017-07-14 33 views
0

因此,首先我有使用服務的項目,並使用配置服務向其他服務提供配置。如果我提供虛擬機參數:使用springboot native.search-locations進行服務配置:file:/// yaml

-Dspring.cloud.config.server.native.search-locations=file:///"D:\work projects\...\src\config\config-repo\local" 

然後服務可以訪問配置。 我的問題是,我想使用文件applciation-local.yml內輪廓springboot配置(配置文件被激活)提供的配置:

spring.cloud.config.server.native.search-locations: file:///config/config-repo/local 

服務配置返回空配置像 「{}」

file:///路徑有問題嗎?

module-project tree

+0

你用'classpath:'而不是'file:///'試過了嗎? – alfcope

回答

0

由於@alfcope評論,請使用:

classpath:/config-repo/local 

工作。當然,配置文件夾必須標記爲資源文件夾。

相關問題