Changing the `glue` path for a Gradle+Cucumber project

How can I change the glue path for a Gradle+Cucumber project?

This is the relevant part of a build.gradle file:

task cucumber() {
    dependsOn assemble, compileTestJava
    doLast{
        javaexec {
            main = "cucumber.api.cli.Main"
            classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
            args = ['--plugin', 'pretty', '--glue', 'gradle.cucumber', 'src/main/java/features']
        }
    }
}

When I run the >gradle cucumber from the command line, I get notified scenarios are not defined, because glue file is not in the /main folder, rather in /main/java/stepmethods .

How do I tell that to Gradle?

I got the answer on SO:

I just needed to replace gradle.cucumber with my actual step definition package.