@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
时间: 2024-04-25 17:24:37 浏览: 164
@SpringBootApplication注解到底做了什么,你真的了解吗?
回答: @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })这个注解的作用是排除自动注入数据源的配置,即取消数据库配置。在Spring Boot中使用多数据源时,可以使用这个注解来排除默认的数据源配置,以便使用自定义的数据源配置。\[1\]\[2\]\[3\]
#### 引用[.reference_title]
- *1* *2* [@SpringBootApplication exclude = {DataSourceAutoConfiguration.class} 失效的解决方案](https://blog.csdn.net/shi860715/article/details/113737078)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [SpringBoot @SpringBootApplication(exclude={DataSourceAutoConfiguration.calss})](https://blog.csdn.net/wangrongfei136/article/details/108622712)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文