在我的spring cloud config server 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
在my spring cloud config client bootstrap.properties中
server.port=1081
spring.application.name=MY_SERVICE
spring.cloud.config.uri=http://localhost:1080
我正在尝试使用访问git repo中的属性 @Value
在我的微服务,但它是给错误 Could not resolve placeholder 'third-party-cred' in value "${third-party-cred}"
1条答案
按热度按时间2guxujil1#
解决方案
默认情况下不启用bootstrap.properties。请在微服务中添加此依赖项。