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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM