Using Cucumber with Gradle with tags

I want to run Cucumber from Gradle with the possibility to specify tags. Here is a build.gradle to do this:

  • gradle cucumber - will run all cucumber scenarios but not these tagged with @Ignore
  • gradle cucumber -P tags=@Smoketest - will run all smoketests but again will ignore these with the tag @Ignore.