liveBook · Manning

Maven

As explained in BDD in Action, Second Edition

Maven is a build automation and project management tool widely used for Java projects.

Maven automates building and running Java projects, giving teams a conventional project structure and a repeatable way to execute automated acceptance tests. section 3.5.1 section 8.2.2

A Maven-based acceptance-testing project typically separates:

  • Application code and resources under src/main. section 8.2.2
  • Java test code and test resources under src/test. section 8.2.2
  • Cucumber feature files under src/test/resources/features, with glue code and runners organized in Java packages. section 8.2.2

Verify a starter project

After creating or cloning a Maven project, run `mvn verify`. Maven scans the project, runs the tests, and reports whether the build succeeds. A Serenity Cucumber starter project supplies a skeleton structure with Cucumber and Serenity BDD dependencies already arranged. section 3.5.1

$ cd train-timetables
$ mvn verify
[INFO] Scanning for projects...
...
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
...
[INFO] --------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] --------------------------------------------------------------------
[INFO] Total time:  14.320 s
[INFO] Finished at: 2021-10-09T07:54:04+01:00
[INFO] --------------------------------------------------------------------

Inspect the command-line verification output, including test execution and the final BUILD SUCCESS result. section 3.5.1

How BDD in Action, Second Edition covers it

How deep it goes
Shows project setup, conventional directories, and verification, but does not detail Maven configuration internals.
Examples
Uses a Serenity Cucumber starter project, train-timetables repository, standard directories, and the `mvn verify` command.
What it assumes
Assumes basic Java project familiarity while requiring a Java JDK, Maven, and optionally Git and GitHub.
What you can do after
Operate/configure a Java acceptance-testing project and verify its build from the command line.
How it connects
Connects Java projects with Cucumber, Serenity BDD, GitHub templates, acceptance testing, and Gradle-style project organization.

Also explained in

Compare how 2 books explain Maven →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of BDD in Action, Second Edition. The section links point to the parts of the book it draws on.