Java Can';t在Intellij gradle中运行单独的测试
我试图用Gradle创建一个项目,当我运行单独的测试时,我得到了这个错误 信息:2016年10月26日11:22-编译完成,出现1个错误和0个错误 158ms错误中的警告:gradle资源测试:Sunday-Sessions\u测试: java.lang.NoSuchMethodError: org.gradle.api.specs.AndSpec.getSpecsArray() 我尝试过刷新gradle项目,也做过file->invalidate caches和restart,但都没有用。这是我的gradle文件,有人知道为什么会这样吗Java Can';t在Intellij gradle中运行单独的测试,java,gradle,build.gradle,Java,Gradle,Build.gradle,我试图用Gradle创建一个项目,当我运行单独的测试时,我得到了这个错误 信息:2016年10月26日11:22-编译完成,出现1个错误和0个错误 158ms错误中的警告:gradle资源测试:Sunday-Sessions\u测试: java.lang.NoSuchMethodError: org.gradle.api.specs.AndSpec.getSpecsArray() 我尝试过刷新gradle项目,也做过file->invalidate caches和restart,但都没有用。这是
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "io.ratpack:ratpack-gradle:1.3.3"
classpath "com.github.jengelman.gradle.plugins:shadow:1.2.3"
}
}
ext {
// The drivers we want to use
drivers = ["chrome", "phantomJs"]
ext {
gebVersion = '0.13.1'
seleniumVersion = '2.52.0'
chromeDriverVersion = '2.19'
phantomJsVersion = '1.9.7'
}
}
apply plugin: "io.ratpack.ratpack-groovy"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "idea"
apply plugin: "eclipse"
repositories {
jcenter()
}
dependencies {
// Default SLF4J binding. Note that this is a blocking implementation.
// See here for a non blocking appender http://logging.apache.org/log4j/2.x/manual/async.html
runtime 'org.slf4j:slf4j-simple:1.7.12'
// If using Spock, need to depend on geb-spock
testCompile("org.gebish:geb-spock:$gebVersion") {
exclude group: 'org.codehaus.groovy'
}
testCompile("org.spockframework:spock-core:1.0-groovy-2.4") {
exclude group: "org.codehaus.groovy"
}
// If using JUnit, need to depend on geb-junit (3 or 4)
testCompile("org.gebish:geb-junit4:$gebVersion") {
exclude group: "org.codehaus.groovy"
}
// http://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '2.52.0'
compile "org.shamdata:sham:0.3"
// Drivers
testCompile "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
// using a custom version of phantomjs driver for now as the original one does not support WebDriver > 2.43.1
testCompile("com.codeborne:phantomjsdriver:1.2.1") {
// phantomjs driver pulls in a different selenium version
transitive = false
}
testCompile('io.ratpack:ratpack-remote-test:1.3.0') {
exclude group: "org.codehaus.groovy"
}
// http://mvnrepository.com/artifact/com.google.inject/guice
compile group: 'com.google.inject', name: 'guice', version: '3.0'
compile 'io.ratpack:ratpack-handlebars:1.2.0'
compile 'com.fasterxml.jackson:jackson-parent:2.7-1'
compile 'postgresql:postgresql:9.1-901-1.jdbc4'
compile 'org.codehaus.groovy:groovy-all:2.4.4'
testCompile ratpack.dependency('test')
compile ratpack.dependency("remote")
testCompile ratpack.dependency("remote-test")
compile ratpack.dependency("hikari")
// https://mvnrepository.com/artifact/com.restfb/restfb
compile group: 'com.restfb', name: 'restfb', version: '1.26.0'
//Grab the user location with GeoIP2
compile 'com.maxmind.geoip2:geoip2:2.8.0-rc1'
}
如果您运行所有测试,它们是否运行?您可以通过命令行运行单个测试吗?如果它们以前工作过,而您刚刚升级过,这可能是同一问题吗?如果我这样做。/gradlew检查它是否工作正常,我将检查链接,谢谢您如果您运行所有测试,它们是否运行?您可以通过命令行运行单个测试吗?如果它们以前工作过,并且您刚刚升级了,这可能是同一个问题吗?如果我升级了。/gradlew检查它是否正常工作,我将检查链接,谢谢