在做谷粒商城P23时,在nacos配置列表修改配置内容后,刷新网页看不到内容发生变化,只有在application.properties里修改才会发生变化,发现是bootstrap.properties文件没有被加载的原因。
参考链接:spring boot项目不加载 bootstrap.properties 文件_田埂、的博客-CSDN博客
但问题还是没有解决
直到参考此文章:
Spring Boot 不加载 bootstrap.properties/yml 配置文件 - 代码召唤师 - 博客园
在gulimall-commom -- pom.xml中添加了
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
</dependency>
然后就成功了!