![]() |
VOOZH | about |
To exclude specific TestNG groups from execution when running tests through Maven, you can configure the maven-surefire-plugin in the Maven pom.xml file. The Surefire plugin is responsible for running the unit tests during the build process, and it supports excluding certain groups from being executed.
Following are the steps to exclude TestNG groups from Maven:
TestClass1.java
Output:
In order to run the project. Open the terminal and write the following command, this will exclude the group.
mvn test
By configuring the maven-surefire-plugin in the pom.xml file and using the <excludedGroups> tag, you can easily exclude specific TestNG groups from being executed during the Maven build process. This allows for greater flexibility in controlling which tests are run, especially in scenarios where certain tests are not relevant or are under development.