Spring Boot 看起来像最初的问题是与自动配置。 如果你不需要数据源,只需从自动配置过程中删除它: @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})