spring boot 排除个别配置类的代码

废话不说,直接上代码

@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
@EnableScheduling
@ComponentScan(basePackages = {"com.hudai.platform.sms.vendor","com.hudai.platform.scp"}, excludeFilters =
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = com.hudai.platform.scp.alert.config.RestTemplateConfig.class))
public class SmsVendorApplication {

    public static void main(String[] args) {
        SpringApplication.run(SmsVendorApplication.class, args);
    }

}

excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = com.hudai.platform.scp.alert.config.RestTemplateConfig.class))
这段是经典
posted @ 2019-02-13 18:08  兔老霸夏  阅读(6361)  评论(0编辑  收藏  举报