举例说明

新建了一个springboot工程,运行程序时报错:Reason: Failed to determine a suitable driver class
在这里插入图片描述
问题原因: 新工程中未进行数据源信息配置。如果去掉springboot工程相关自动配置,该问题就不会出现了
解决办法:

@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class })
public class UmeApiPlusApplication {
    public static void main(String[] args) {
        SpringApplication.run(UmeApiPlusApplication.class, args);
    }
}

总结

使用@SpringBootApplication(exclude = {})可去除springboot工程的自动配置