title: Maven TestNG project, pass command line arguments to testng.xml file
body: <p>I have a Maven TestNG project, and am trying pass couple of command line arguments into the testng.xml file.</p>
  
  <p>The testng.xml file looks like below:</p>
  
  <pre><code>&lt;suite name="Test Suite" parallel="classes" thread-count="100" &gt;
    &lt;test name="VIP Tests"&gt;
      &lt;parameter name="browser" value="${browser}" /&gt;
      &lt;groups&gt;
          &lt;run&gt;
              &lt;include name="${test.scope}" /&gt;
          &lt;/run&gt;
      &lt;/groups&gt;
      &lt;packages&gt;
          &lt;package name="com.tests.*" /&gt;
      &lt;/packages&gt;
    &lt;/test&gt; 
  &lt;/suite&gt;
  </code></pre>
  
  <p>The pom.xml file looks like below:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;Test_Project&lt;/groupId&gt;
  &lt;artifactId&gt;TP_X&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;build&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/test/resources&lt;/directory&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
      &lt;sourceDirectory&gt;${src.dir}&lt;/sourceDirectory&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.19.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;suiteXmlFiles&gt;
                     &lt;suiteXmlFile&gt;src/test/resources/testng.xml&lt;/suiteXmlFile&gt;
                  &lt;/suiteXmlFiles&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Now, every time I attempt to execute the Maven test command </p>
  
  <pre><code>mvn clean test -U -Dtest.scope=smoke -Dbrowser=chrome
  </code></pre>
  
  <p>I get the following error in the command line:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project VIP_QE: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an error in the forked process
  [ERROR] java.util.regex.PatternSyntaxException:
  [ERROR] Illegal repetition near index 0
  [ERROR] ${test.scope}
  </code></pre>
  
  <p>Can someone please help? I have been stuck with this problem for about a week.</p>