springboot禁用特定的自动配置类
所属分类 springboot
浏览量 1020
方法1
@EnableAutoConfiguration(exclude = DataSourceAutoConfiguration.class)
public class MyConfiguration {}
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class,XADataSourceAutoConfiguration.class})
方法2
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class MyConfiguration { }
方法3
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
启动日志里会显示禁用的自动配置类
Exclusions:
-----------
com.dyyx.mystarter.configuration.MyStarter2AutoConfiguration
spring-boot-starter原理
自定义springboot starter
上一篇
下一篇
GO mutex 与 atomic 性能对比
cannot find GOROOT directory
自定义springboot starter
go defer 延迟函数
java NIO http server
http request to javabean