无法在Intellij gradle中运行单独的测试

时间:2016-10-26 10:24:55

标签: java intellij-idea gradle groovy build.gradle

我正在尝试使用Gradle创建一个项目,当我运行单个测试时,我收到此错误。

  

信息:26/10/16 11:22 - 编译完成,错误为1,错误为0   158ms中的警告错误:gradle-resources-test:Sunday-Sessions_test:   java.lang.NoSuchMethodError:   org.gradle.api.specs.AndSpec.getSpecsArray()[Lorg / gradle这个/ API /功能/规格;

我尝试刷新gradle项目,并且还完成了file-> invalidate缓存和重启,这没有帮助。这是我的gradle文件,任何人都可以看到为什么会发生这种情况吗?

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'

}

0 个答案:

没有答案