title: How to override TestNG parameters from the calling program
body: <p>I am using TestNG 6.0 with Maven Surefire 2.18.  I am trying to use a default value for a parameter in my testng.xml file and override it in my Maven pom.xml, which references the testng.xml file for its default values.  Here is a sample of my code:</p>
  
  <pre><code>class TestClass {
      @Parameters({ "parm1" })
      @BeforeClass
      void setup(String parm1) {
          System.out.println("parm1 = " + parm1);
      }
  }
  </code></pre>
  
  <p>Here is my testng.xml file:</p>
  
  <pre><code>&lt;suite name="suite1"&gt;
      &lt;parameter name="parm1" value="Default Value"&gt;
      &lt;test name="myTest"&gt;
          &lt;classes&gt;
              &lt;class name="TestClass"/&gt;
          &lt;/classes&gt;
      &lt;/test&gt;
  &lt;/suite&gt;
  </code></pre>
  
  <p>And here is the surefire plugin entry in my pom.xml file:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
      &lt;configuration&gt;
          &lt;suiteXmlFiles&gt;
              &lt;suiteXmlFile&gt;testng.xml&lt;/suiteXmlFile&gt;
          &lt;/suiteXmlFiles&gt;
          &lt;systemPropertyVariables&gt;
              &lt;parm1&gt;Override Value&lt;/parm1&gt;
          &lt;/systemPropertyVariables&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>