- 问题描述:
2023-08-10 11:52:32.992 ERROR 13064 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : ***************************
APPLICATION FAILED TO START
***************************Description:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.Reason: Failed to determine a suitable driver classAction: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 particular profile you may need to activate it (no profiles are currently active).Process finished with exit code 1
- 原因:之前为了不打包yaml文件放到jar包里面,我在pom.xml的
<build></build>
标签中中配置了如下代码,导致idea运行时读不到yaml文件:
<resources><resource><directory>src/main/resources</directory><filtering>true</filtering><excludes><exclude>**/*.yaml</exclude></excludes></resource></resources>
把这段注释掉,并且重新 maven package
一下就好了