-
检查application.properties或者application.yml文件中是否添加了数据库配置
spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/test?useSSL=false&useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai username: root password: 123456
-
maven自动化打包时,默认只编译src/main/java中的java文件,其他的文件会被忽略。在pom.xml文件中配置如下让Maven识别并扫描到静态资源文件。
<build>
SpringBoot项目报错:Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedd
最新推荐文章于 2024-03-12 08:30:00 发布