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,解決!