springboot运行路径错误

springboot项目中运行路径问题,错误如下

2023-04-13 10:48:12.435 ERROR 10624 --- [           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 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).


database 连接数据库配置错误,无法连接到数据源的url,看下是数据源配置url的问题,还是什么问题

你是不是没有在application.yml文件中定义数据库配置,如果不需要使用数据库,就在启动类的SpringBootApplication注解后面加上
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

只要在将@SpringBootApplication修改为@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})就可以启动的时候不需要连接数据库。