解决报错:Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource
解决SpringBoot项目没用数据库但报错:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
·
解决SpringBoot项目没用数据库但报错:Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.
1、在@SpringBootApplication后添加exclude = { DataSourceAutoConfiguration.class }来排除自动配置 :
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
2、在application.yml文件中添加排除自动配置
spring:
autoconfigure:
exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
已为社区贡献10条内容
所有评论(0)