spring boot 创建项目引用mybatis后,直接运行会提示:
Cannot determine embedded database driver class for database type NONE
因为springboot启动时会自动注入数据源
使用@SpringBootApplication注解排除注入即可
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class}) public class Application { public static void main(String[] args){ SpringApplication.run(Application.class, args); } }