错误截图
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
10:30:02.744 logback [main] ERROR 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 class

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 particular profile you may need to activate it (no profiles are currently active).

出现此错误的原因是在多模块的maven项目中 springboot没有读到配置文件造成的,所以只用在此模块的最外层pom文件中添加

      <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.yml</include>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.yml</include>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>

小星星
1 声望1 粉丝