Building on @hfc's answer, if you have both JUnit and TestNG on the classpath and you don't want to remove JUnit, you can do so by declaring the surefire-testng
dependency on the maven-surefire-plugin
:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.3</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-testng</artifactId>
<version>3.5.3</version>
</dependency>
</dependencies>
</plugin>