今天爱分享给大家带来【面试题详解】之 bootstrap.properties 和 application.properties 有何区别 ,希望给大家带来帮助!
单纯做 Spring Boot 开发,可能不太容易遇到 bootstrap.properties 配置文件,但是在结合 Spring Cloud 时,这个配置就会经常遇到了,特别是在需要加载一些远程配置文件的时侯。
bootstrap.properties 在 application.properties 之前加载,配置在应用程序上下文的引导阶段生效。一般来说我们在 Spring Cloud Config 或者 Nacos 中会用到它。bootstrap.properties 被 Spring ApplicationContext 的父类加载,这个类先于加载 application.properties 的 ApplicatonContext 启动。
当然,前面叙述中的 properties 也可以修改为 yam。
原文链接:http://blog.itblood.com/1765.html,转载请注明出处。

![爱的初体验官方中文正式版[电脑/18G] [真人SLG大作/官中/动态]](/wp-content/uploads/replace/2025/07/19/32df13ab6ad263c8e3911614a7018bdf.webp)