【发布时间】:2020-11-21 12:48:24
【问题描述】:
在我的 spring 云配置服务器 application.properties 中。我在我的应用程序类中通过了@EnableConfigServer
spring.application.name=CONFIG_SERVER
server.port=1080
spring.cloud.config.server.git.uri=PATH_TO_GITHUB_REPO
spring.cloud.config.server.git.username=USNM
spring.cloud.config.server.git.password=PWD
spring.cloud.config.server.git.skip-ssl-validation=true
在我的 git repo application.properties 中
third-party-cred=MY_VALUE
在我的 spring 云配置客户端 bootstrap.properties
server.port=1081
spring.application.name=MY_SERVICE
spring.cloud.config.uri=http://localhost:1080
我正在尝试在我的微服务中使用 @Value 访问 git repo 中存在的属性,但它给出了错误 Could not resolve placeholder 'third-party-cred' in value "${third-party-cred}"
【问题讨论】:
标签: java spring spring-boot spring-mvc microservices