版本
springcloud 2020.0.4 nacos 1.4
现象
项目启动时日志显示有成功加载到配置文件,但实际运行中取到的配置值仍为项目打包的默认配置文件值
b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name=‘bootstrapProperties-client-test.yml,platform’}, BootstrapPropertySource {name=‘bootstrapProperties-client.yml,platform’}, BootstrapPropertySource {name=‘bootstrapProperties-client,platform’}]
解决
将application.yml配置文件中的以下条目放到bootstrap.yml文件中即可
代码语言:javascript复制spring:
application:
name: client
profiles:
active: test