Gradle fails to resolve cucumber dependencies

The following script doesn’t resolve cucumber dependencies (cucumber-core, cucumber-html, cucumber-java, cucumbur-junit, cucumber-jvm-deps):

apply plugin: 'java'
apply plugin: 'idea'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    testCompile 'junit:junit:4.11'
    //testCompile 'info.cukes:cucumber-spring:1.2.4'
    testCompile 'info.cukes:cucumber-core:1.2.4'
    testCompile 'info.cukes:cucumber-html:0.2.3'
    testCompile 'info.cukes:cucumber-java:1.2.4'
    testCompile 'info.cukes:cucumber-junit:1.2.4'
    testCompile 'info.cukes:cucumber-jvm-deps:1.0.5'
} 

If I try to execute gradle dependencies I get this output:

------------------------------------------------------------
Root project
------------------------------------------------------------

archives - Configuration for archive artifacts.
No dependencies

compile - Compile classpath for source set 'main'.
No dependencies

default - Configuration for default artifacts.
No dependencies

runtime - Runtime classpath for source set 'main'.
No dependencies

testCompile - Compile classpath for source set 'test'.
+--- junit:junit:4.11
|    \--- org.hamcrest:hamcrest-core:1.3
+--- info.cukes:cucumber-core:1.2.4 FAILED
+--- info.cukes:cucumber-html:0.2.3 FAILED
+--- info.cukes:cucumber-java:1.2.4 FAILED
+--- info.cukes:cucumber-junit:1.2.4 FAILED
\--- info.cukes:cucumber-jvm-deps:1.0.5 FAILED

testRuntime - Runtime classpath for source set 'test'.
+--- junit:junit:4.11
|    \--- org.hamcrest:hamcrest-core:1.3
+--- info.cukes:cucumber-core:1.2.4 FAILED
+--- info.cukes:cucumber-html:0.2.3 FAILED
+--- info.cukes:cucumber-java:1.2.4 FAILED
+--- info.cukes:cucumber-junit:1.2.4 FAILED
\--- info.cukes:cucumber-jvm-deps:1.0.5 FAILED

BUILD SUCCESSFUL

maven can solve these dependencies correctly. ¿What can be the reason that Gradle can’t resolve it?

When using the build script snippet you provided this resolves correctly for me with Gradle 2.13. Can you run the build with --info? This perhaps might give some more insight into what is going on.

I upgraded from 2.8 to 2.13 and now resolves dependencies correctly . But I think that there was a problem with the repository.

Thanks for reply!

I’m getting same error. What should I do ? BTW I’m very new to gradle.

testCompileClasspath - Compile classpath for source set ‘test’.
±-- org.seleniumhq.selenium:selenium-java:3.4.0 FAILED
±-- info.cukes:cucumber-junit:1.2.5 FAILED
±-- info.cukes:cucumber-java:1.2.5 FAILED
±-- junit:junit:4.12 FAILED
— info.cukes:cucumber-picocontainer:1.2.4 FAILED

testCompileOnly - Compile only dependencies for source set ‘test’. (n)
No dependencies

testImplementation - Implementation only dependencies for source set ‘test’. (n)
No dependencies

testRuntimeClasspath - Runtime classpath of source set ‘test’.
±-- org.seleniumhq.selenium:selenium-java:3.4.0 FAILED
±-- info.cukes:cucumber-junit:1.2.5 FAILED
±-- info.cukes:cucumber-java:1.2.5 FAILED
±-- junit:junit:4.12 FAILED
— info.cukes:cucumber-picocontainer:1.2.4 FAILED

testRuntimeOnly - Runtime only dependencies for source set ‘test’. (n)
No dependencies

A web-based, searchable dependency report is available by adding the --scan option.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings