【问题标题】:Gradle downloads pom.xml but not the .jar file for CucumberGradle 下载 pom.xml 但不下载 Cucumber 的 .jar 文件
【发布时间】:2013-07-08 22:51:27
【问题描述】:

我正在尝试让 Cucumber 从 Gradle 运行。当我尝试执行 Cucumber 测试时,我得到了

Error: Could not find or load main class cucumber.api.cli.Main

Gradle 下载了 cucumber-jvm-1.1.3.pom 文件,但没有下载任何 cucumber .jar 文件。这是我的 build.gradle:

apply plugin: 'java'

repositories {
    mavenCentral()
}

dependencies {
    compile 'info.cukes:cucumber-jvm:1.1.3'
}


configurations {
    cucumberRuntime {
        extendsFrom testRuntime
    }
}

task runCucTests(type: JavaExec) {

    main = "cucumber.api.cli.Main"
    classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
    args = ['-f', 'pretty', '--glue', 'gradle.cucumber', 'src/test/resources', '--tags @complete', ' --format junit:target/reports/cucumber-junit-report/allcukes.xml', '--format pretty', '--format html:target/reports/cucumber-html-report']
}

我尝试将依赖项更改为运行时并将 cucumberRuntime 更改为从运行时扩展,但结果是相同的。

为什么 gradle 不能识别它需要下载 cucumber .jar 文件?

谢谢。

【问题讨论】:

    标签: gradle cucumber-jvm


    【解决方案1】:

    cucumber-jvm 是父组

    cucumber.api.cli.Main 需要 cucumber-core

    在下面使用:

    依赖{

    compile "info.cukes:cucumber-core:1.1.3"
    

    }

    这将下载所需的 jar。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-01-05
      • 2018-10-09
      • 2015-11-30
      • 1970-01-01
      • 1970-01-01
      • 2020-09-12
      • 1970-01-01
      相关资源
      最近更新 更多