How to do it...

  1. Install Cucumber. The Cucumber installation is nothing more than adding the framework to the project as a Maven dependency. Since we are going to add several Cucumber JAR files and all of them have to be of the same version, it makes sense to add the cucumber.version property in pom.xml first:
    <properties>        <cucumber.version>3.0.2</cucumber.version>    </properties>

Now we can add the Cucumber main JAR file in pom.xml as a dependency:

<dependency>    <groupId>io.cucumber</groupId>    <artifactId>cucumber-java</artifactId>    <version>${cucumber.version}</version>    <scope>test</scope></dependency>

Alternatively, if you prefer a fluent stream-based style of coding, you can add a different Cucumber main JAR file:

<dependency> <groupId> ...

Get Java 11 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.