title: How to Pass the features folder dynamically to a Jenkins->Maven->Testng Runner File
body: <p>In my jenkins pipeline I am invoking my test like</p>
  
  <pre><code>"mvn test -Drun_location=US"
  </code></pre>
  
  <p>And my pom.xml file looks like this</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;version&gt;2.16&lt;/version&gt;
      &lt;configuration&gt;
          &lt;systemPropertyVariables&gt;
              &lt;run.location&gt;${run_location}&lt;/run.location&gt;
          &lt;/systemPropertyVariables&gt;
          &lt;suiteXmlFiles&gt;
              &lt;suiteXmlFile&gt;${basedir}/testng.xml&lt;/suiteXmlFile&gt;
          &lt;/suiteXmlFiles&gt;
          &lt;skipTests&gt;false&lt;/skipTests&gt;
          &lt;testFailureIgnore&gt;false&lt;/testFailureIgnore&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>And my testng.xml file looks like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"&gt;
  &lt;suite&gt;
    &lt;test&gt;
    &lt;parameter name="location" value="${run_location}"/&gt;
     &lt;classes&gt;
        &lt;class name="com.test.Runner_Jenkins"/&gt;
      &lt;/classes&gt;
    &lt;/test&gt; 
  &lt;/suite&gt; 
  </code></pre>
  
  <p>I need to pass this parameter to my runner file to set the feature directory dynamically. How do I accomplish this.</p>
  
  <pre><code>@CucumberOptions (
  features = {"features/${run_location}"},
  glue = "StepDefinitions"
  ) 
  </code></pre>