Based on the command you've given
mvn clean install surefire:test -Dtests=myTestNGSuite test
BTW: Where the parameter tests should be named test
which means to run through the install life-cycle which means to run through the following steps:
- validate
- initialize,
- generate-sources,
- process-sources,
- generate-resources,
- process-resources,
- compile,
- process-classes,
- generate-test-sources,
- process-test-sources,
- generate-test-resources,
- process-test-resources,
- test-compile,
- process-test-classes,
- test,
- prepare-package,
- package,
- pre-integration-test,
- integration-test,
- post-integration-test,
- verify,
- install
as you can see that within this life-cycle the test phase has already been run...in Other words the surefire:test does not make sense nor the test which would run the life-cycle like this:
- validate
- initialize,
- generate-sources,
- process-sources,
- generate-resources,
- process-resources,
- compile,
- process-classes,
- generate-test-sources,
- process-test-sources,
- generate-test-resources,
- process-test-resources,
- test-compile,
- process-test-classes,
- test,
So to run the suite within TestNG it is sufficient to call Maven like this:
mvn -Dtest=myTestNGSuite test
or if you have run the test life cylce before this can be shortent to:
mvn -Dtest=myTestNGSuite surefire:test
Furthermore usually you shouldn't use test suites neither in JUnit nor in TestNG cause maven-surefire-plugin will automatically recognize the unit tests within the correct locaiton (src/test/java). so there is no need to write Test Suites. BTW you should define an more up-to-date version of the maven-surefire-plugin (2.13 in the meantime).