spring.profile.active
时间: 2023-08-24 11:09:15 浏览: 138
在Spring Boot中,spring.profiles.active属性用于指定当前所选的profile,即在多个配置文件中选择一个特定的配置文件来加载。通过在application.properties或application.yml文件中设置spring.profiles.active属性的值,可以指定要激活的profile。例如,如果希望激活名为"dev"的profile,可以在配置文件中设置spring.profiles.active=dev。这样,在启动应用程序时,Spring Boot将加载与该profile相关的配置。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [【开发细节】SpringBoot配置文件的spring.profiles下的active和include属性的区别和作用](https://blog.csdn.net/qq_44778023/article/details/131231225)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [使用 spring.profiles.active来区分配置(未全、未亲测)](https://blog.csdn.net/weixin_46055693/article/details/122246834)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文