Can I run a specific testng test group via maven?

Tom Eustace picture Tom Eustace · May 27, 2010 · Viewed 24k times · Source

I have several testng test groups, e.g. group1,group2,group3... These are defined in my pom.xml and all get run when I execute "mvn test". What do I need to run to only execute one group without having to modify the groups configured in the pom.xml.

i.e mvn test group2 mvn test group1 mvn test group3

Answer

Eugene Kuleshov picture Eugene Kuleshov · May 27, 2010

Try

mvn test -Dgroups=group3,group2