Java 带有gradle和Jacoco插件的Spring Boot

Java 带有gradle和Jacoco插件的Spring Boot,java,spring,gradle,jacoco,Java,Spring,Gradle,Jacoco,当我将jacoo插件添加到我的项目中时应用插件:“Jacoco”。然后,与数据库集成的单元测试就不起作用了 Spring数据源配置(application.yml): 我使用1.3.6.0版本的spring boot,并以以下方式配置了Jacoco: jacoco { toolVersion = "0.7.6.201602180812" reportsDir = file("$buildDir/customJacocoReportDir") } jacocoTestReport

当我将jacoo插件添加到我的项目中时
应用插件:“Jacoco”
。然后,与数据库集成的单元测试就不起作用了

Spring数据源配置(application.yml):

我使用1.3.6.0版本的spring boot,并以以下方式配置了Jacoco:

jacoco {
    toolVersion = "0.7.6.201602180812"
    reportsDir = file("$buildDir/customJacocoReportDir")
}

jacocoTestReport {
    reports {
        xml.enabled false
        csv.enabled false
        html.destination "${buildDir}/jacocoHtml"
    }
}
当我想启动单元测试时,stacktrace会给我:

org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (the profiles "test" are currently active).
at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.getDriverClassName(DataSourceProperties.java:180)
at org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$NonEmbeddedConfiguration.dataSource(DataSourceAutoConfiguration.java:121)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)

任何人都知道发生了什么(正如我提到的,没有Jacoco,一切都正常)?

什么是gradle taks,它没有通过任务测试,或者当我通过IntelliJ测试运行程序运行它时,你有没有尝试过删除你对Jacoco的定制,我的意思是,删除你上面发布的所有内容,只需使用这行“应用插件:”Jacoco“是的,但仍然以同样的方式失败。你能提供一个github回购协议来检查发生了什么事吗?什么是gradle taks导致任务测试失败,或者当我通过IntelliJ测试运行程序运行它时,你有没有尝试过删除你对jacoco的定制,我的意思是,删除上面发布的所有内容,只需使用这行“应用插件:“jacoco”是的,但仍然以同样的方式失败。你能提供github回购协议来检查发生了什么吗?
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (the profiles "test" are currently active).
at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.getDriverClassName(DataSourceProperties.java:180)
at org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$NonEmbeddedConfiguration.dataSource(DataSourceAutoConfiguration.java:121)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)