springboot Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test ,default-test on project springboot-mybatis: There are test failures.

springboot Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project springboot-mybatis: There are test failures.

springboot创建项目maven install报错 ,

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project springboot-mybatis: There are test failures.

寻找有用信息:

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

未能配置数据源:未指定“url”属性,无法配置嵌入的数据源。

于是推测可能我是引入了数据库相关依赖但并没有对其进行任何的配置,以至于报错。

在application.properties中配置:

#spring.datasource.username=root
#spring.datasource.password=xingfu
#spring.datasource.url=jdbc:mysql://localhost:3306/jdbctest?serverTimezone=UTC&useUnicode=true&characterEncoding=uft-8
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

或者在application.yml中配置相关内容。

重新maven install,解决!