10 Running JUnit tests from Maven 3

This chapter covers

  • Creating a Maven project from scratch
  • Testing the Maven project with JUnit 5
  • Using Maven plugins
  • Using the Maven Surefire plugin

The conventional view serves to protect us from the painful job of thinking.

--John Kenneth Galbraith

This chapter discusses a common build system tool called Maven. In the previous chapters, with provided Maven projects, you needed only to look at some external dependencies, run some simple commands, or run the tests from inside the IDE. This chapter gives you a brief introduction to the Maven build system, which will be very useful if you need a systematic way to start your tests.

Maven addresses two aspects of building software. First, it describes how software ...

Get JUnit in Action, Third Edition 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.