Forum Discussion

DenGuzawr22's avatar
New Contributor
2 years ago

Cucumber executable jar has undefined scenarios

I try to create an executable jar for my cucumber Kotlin application but it prints in log that all scenarios are undefined:

3 Scenarios (3 undefined)
8 Steps (5 skipped, 3 undefined)

The application can be executed correctly from command line or from IntelliJ


Entry point of program:

package dsdms.client
import io.cucumber.core.cli.Main

class Main{
    companion object{
        fun main(args: Array<String>) {
            Main.main("-p", "pretty",
                "--glue", "dsdms.client.cucumber",
                "--plugin", "html:build/reports/cucumber",
            println("Hello Worldddd2!")



For project building I use Gradle with Kotlin DSL


I tried to use first src/test and then src/main folders but even if I can execute all correctly form console, the jar can't to find the step definitions

For fat jar generation I use:


tasks.withType<Jar> {
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
    manifest {
        attributes["Main-Class"] = "dsdms.client.Main"

        configurations.runtimeClasspath.get().filter {"jar") }.map { zipTree(it) }