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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.