我无法运行"com.github.samueltbrown.cucumber“插件的黄瓜任务。
我得到以下错误:
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文件:
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'
}
}
发布于 2020-04-03 10: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在某一时刻从一个文件变成了一个文件集合。
https://stackoverflow.com/questions/60989445
复制相似问题