zoukankan      html  css  js  c++  java
  • 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,解决!

  • 相关阅读:
    static用法
    Spring相关配置及工厂模式
    Mybatis的相关配置及理解
    jsp内置对象简介
    JAVA基础——接口的理解
    JAVA基础——抽象类以及final修饰符总结
    关于JAVA基础 ——继承的总结
    封装
    static的用法
    构造方法的重载
  • 原文地址:https://www.cnblogs.com/gyl5201314/p/12997399.html
Copyright © 2011-2022 走看看