首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >在org.gradle.api.internal.file.DefaultSourceDirectorySet类型的cucumber Java源代码上找不到方法outputDir()

在org.gradle.api.internal.file.DefaultSourceDirectorySet类型的cucumber Java源代码上找不到方法outputDir()
EN

Stack Overflow用户
提问于 2020-04-02 18:28:07
回答 1查看 77关注 0票数 1

我无法运行"com.github.samueltbrown.cucumber“插件的黄瓜任务。

我得到以下错误:

代码语言:javascript
代码运行次数:0
运行
复制
FAILURE: Build failed with an exception.

* Where:
Build file '/Users/freid/app/build.gradle' line: 118

* What went wrong:
A problem occurred evaluating root project 'app'.
> Could not find method outputDir() for arguments [/Users/freid/app/src/cucumber/java] on cucumber Java source of type org.gradle.api.internal.file.DefaultSourceDirectorySet.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s

这是我的build.gradle文件:

代码语言:javascript
代码运行次数:0
运行
复制
buildscript {
    ext {
        springBootVersion='2.2.4.RELEASE'
        lombokVersion='1.18.4'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

plugins {
    id 'org.springframework.boot' version '2.2.4.RELEASE'
    id 'java'
    id 'com.github.psxpaul.execfork' version '0.1.8'
    id "com.jfrog.artifactory" version "4.7.2"
    id "com.github.samueltbrown.cucumber" version "0.9"
}

dependencies {
    testCompile 'info.cukes:cucumber-java:1.2.4'
}

sourceSets {
    cucumber {
        java {
            compileClasspath += main.output + test.output
            runtimeClasspath += main.output + test.output
            srcDir file('src/cucumber/java')
        }
        resources.srcDir file('src/cucumber/resources')
    }
}

cucumber {
    formats = ['html:build/reports/html', 'json:build/reports/cucumber.json']

    jvmOptions {
        environment 'tag', System.getProperty("tag")
        environment 'cucumber.local.server', 'localhost'
    }
}
EN

回答 1

Stack Overflow用户

发布于 2020-04-03 18:28:30

鉴于插件Gradle版本0.9是在2015年发布的,并且您正在尝试使用最近的Spring com.github.samueltbrown.cucumber版本运行,我假设您也在使用最近的Gradle版本。

所以我相信你遇到了插件和Gradle版本之间的不兼容问题。最有可能的情况是,API发生了变化,插件在内部执行的操作不再有效。[/Users/freid/app/src/cucumber/java]看起来像是一组文件的toString,而SourceDirectorySet.outputDir只接受一个File。所以我猜测返回值的API在某一时刻从一个文件变成了一个文件集合。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60989445

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档