Michael Hubbard
Michael Hubbard

Reputation: 81

How to exclude specific unit tests in Maven

I am working on a Maven project and am trying to exclude some tests that should not run in the build phase. However, all the guides I can find give instructions for how to exclude either through command line arguments or with the Surefire plugin. Isn't there a way to exclude the file through the pom.xml without using Surefire, as I'm not using Surefire to run the unit tests in the first place? Where would this exclusion go?

Upvotes: 1

Views: 3105

Answers (1)

Robert Scholte
Robert Scholte

Reputation: 12335

Surefire is the name of the framework for executing tests (it's an abstraction layer for the specific tool). It support JUnit, TestNG and others. To exclude tests by pom.xml, have a look at http://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html

Upvotes: 1

Related Questions