title: Command line syntax for multiple TestNG groups
body: <p>I want to select among multiple TestNG groups from the command line in a Java Maven project. Here's an example:</p>
  
  <pre><code>@Test(groups = { "AAA, BBB, CCC" })
  public class MobileAccountTest {
  
      @Test
      public void testA() {
          System.out.println("* MobileAccountTest.testA()");
      }
  }
  </code></pre>
  
  <p>When I run this in the command line: <code>mvn clean test -Dgroups="AAA"</code>, Maven finds 0 tests to run. Same thing if I run <code>mvn clean test -Dgroups="BBB"</code>. But if I run <code>mvn clean test -Dgroups="CCC"</code>, it does find and run the test. Why does it only recognize the last group entry?
  Based on a TestNG online book extract, I tried this in the java code: <code>@Test(groups = { "AAA.BBB.CCC" })</code>, and then on the command line: <code>mvn clean test -Dgroups="AAA.*"</code>, but that makes Maven throw an error: <code>Caused by: org.apache.maven.surefire.group.parse.TokenMgrError: Lexical error at line 1, column 10.  Encountered: &lt;EOF&gt; after : ""</code></p>
  
  <p>So what is the proper command line syntax?</p>