spring: profiles: active: dev application: name: system-api cloud: nacos: server-addr: 192.168.101.65:8848 discovery: namespace: dev group: xuecheng-plus-project config: namespace: dev group: xuecheng-plus-project file-extension: yaml
读取上述配置,可以得知我们应该在nacos中拉取system-api-dev.yaml
INFO [main][PropertySourceBootstrapConfiguration.java:112] - Located property source: [
BootstrapPropertySource {name='bootstrapProperties-system-service-dev.yaml,xuecheng-plus-project'},
BootstrapPropertySource {name='bootstrapProperties-system-service.yaml,xuecheng-plus-project'},
BootstrapPropertySource {name='bootstrapProperties-system-service,xuecheng-plus-project'}]
可是控制台却告诉我们,他找的是system-service-dev.yaml
在nacos中,其实这两个都是存在的
一开始我选择删除system-service-dev.yaml,但是这时候却直接无法拉取配置了。
这里我用maven执行了clean
果然再启动可以正确读取了system-api-dev.yaml
标签:project,service,配置文件,nacos,dev,system,后缀名,yaml From: https://www.cnblogs.com/kun1790051360/p/18278487