Dcucumber.options, how to have multiple tags

  • To run scenarios with @debug1 and @debug2:

Old version of Cucumber-jvm:

mvn test -Dcucumber.options="--tags @debug1 --tags @debug2"

Actual version of Cucumber-jvm:

mvn test -Dcucumber.options="--tags '@debug1 and @debug2'"
  • To run scenarios with @debug1 or @debug2:

Old version of Cucumber-jvm:

mvn test -Dcucumber.options="--tags @debug1,@debug2"

Actual version of Cucumber-jvm:

mvn test -Dcucumber.options="--tags '@debug1 or @debug2'"

Little late to the party, but I am using something like:

mvn test -D tags="debug1 and debug2"

I am on Cucumber 2.4.

The @ symbol is optional. You can use a tags Maven property. And you can use boolean logic to hook up multiple tags - official docs.

Reduces the amount of typing little bit.


In Cucumber 6, property name has changed. Use:

mvn verify -Dcucumber.filter.tags="@debug1 or @debug2"

For me what was working with surefire plugin:

mvn clean test -D"cucumber.filter.tags=@tag1 or @tag2"

When I tried with this version:

mvn clean test -Dcucumber.filter.tags="not @MyTag"

I got this exception:

io.cucumber.core.exception.CucumberException: Failed to parse 'cucumber.filter.tags' with value '"not @MyTag"'
Caused by: io.cucumber.tagexpressions.TagExpressionException: Tag expression '"not @MyTag"' could not be parsed because of syntax error: expected operator