项目在application.yml 或 application.properties文件已经配置了spring.datasource.url数据库信息情况下,
启动仍报:
Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-configured.
Reason: Failed to determine suitable jdbc url
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a partic
检查pom文件里面 有没有打包成pom
<packaging>pom</packaging>
有的话去掉

本文解决Spring Boot项目中,即使在application.yml或application.properties文件中已正确配置spring.datasource.url,启动时仍出现数据源自动配置失败的问题。文章分析了可能的原因,并提供了详细的排查步骤,包括检查pom文件的打包类型。
522

被折叠的 条评论
为什么被折叠?



