springboot啟動提示缺少資料來源

x號開發者發表於2019-02-26

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently

正解:因為spring boot只要你在pom中引入了mybatis-spring-boot-starter 他就會預設需要載入資料庫相關的配置

可以加上

@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})

相關文章