title: Error when I try to build tests with Gradle and Cucumber
body: <p>I am trying to write functional tests using Cucumber lib, Unfortunately, I can't use Cucumber and Gradle together, an error occurs when building the tests. I am a real beginner in the Java environment. I use for this project: Kotlin / Gradle / Cucumber.</p>
  <p>Here is what my build.gradle.kts looks like</p>
  <pre><code>import org.gradle.jvm.tasks.Jar
  
  plugins {
      application
      `java-library`
      `maven-publish`
      signing
      jacoco
      kotlin(&quot;jvm&quot;) version &quot;1.3.61&quot;
  }
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      implementation(kotlin(&quot;stdlib&quot;))
  
      testImplementation(&quot;org.mock-server:mockserver-netty:5.3.0&quot;)
      testImplementation(&quot;io.cucumber:cucumber-java8:7.0.0&quot;)
      testImplementation(&quot;io.cucumber:cucumber-junit:7.0.0&quot;)
  }
  
  tasks.register&lt;Jar&gt;(&quot;fatJar&quot;) {
      archiveFileName.set(&quot;${artifactName}-${artifactVersion}.jar&quot;)
      duplicatesStrategy = DuplicatesStrategy.EXCLUDE
      manifest {
        attributes(&quot;Main-Class&quot; to application.mainClassName)
      }
      from(configurations.runtimeClasspath.get()
          .onEach { println(&quot;Add from dependencies: ${it.name}&quot;) }
          .map { if (it.isDirectory) it else zipTree(it) })
      val sourcesMain = sourceSets.main.get()
      sourcesMain.allSource.forEach { println(&quot;Add from sources: ${it.name}&quot;) }
      from(sourcesMain.output)
  }
  
  tasks.register&lt;Jar&gt;(&quot;sourcesJar&quot;) {
      from(sourceSets.main.get().allJava)
      archiveClassifier.set(&quot;sources&quot;)
  }
  
  tasks.register(&quot;cucumber&quot;) {
       dependsOn compileTestKotlin
       doLast {
           javaexec {
               main = &quot;io.cucumber.core.cli.Main&quot;
               classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
           }
       }
  }
  </code></pre>
  <p>here is the error</p>
  <pre><code>* What went wrong:
  Script compilation errors:
  
    Line 104:      dependsOn compileTestKotlin
                             ^ Unresolved reference: compileTestKotlin
  
    Line 108:              classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
                                                      ^ Unresolved reference: cucumberRuntime
  
    Line 108:              classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
                                                                                        ^ Unresolved reference: output
  
    Line 108:              classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
                                                                                                                 ^ Unresolved reference: output
  
  4 errors
  </code></pre>
  <p>Thanks for your help.</p>