Developer Center

Maven Projects

ASF

Selecting providers

Selecting a provider

Surefire normally automatically selects which test-framework provider to use based on the version of TestNG/JUnit present in your project's classpath. In some cases it may be desirable to manually override such a selection. This can be done by adding the required provider as a dependency to the surefire-plugin.

The providers supplied with surefire are surefire-junit3, surefire-junit4, surefire-junit47 and surefire-testng. Please note that forcing a provider still requires that the test framework is properly set up on your project classpath.

You can also specify multiple providers as dependencies, and they will all be run and produce a common report. This may be especially handy with external providers, since there are few use-cases for combining the included providers.