title: Selenium - Maven/TestNG: how can we add testng parameters in Java class while adding "main method" to create executable /runnable.jar file?
body: <p>I have project with TestNG, Maven.</p>
  
  <p>I am passing parameters in testng.xml file. Added "main method" for testng config to create executable .jar file.</p>
  
  <p>I have referred -- <a href="https://testng.org/doc/documentation-main.html#running-testng-programmatically" rel="nofollow noreferrer">Running TestNG programmatically</a>. But no method is present there for passing parameters or maybe I have missed that one.</p>
  
  <p>This is how my main method looks like:</p>
  
  <pre><code>public static void main(String[] args) {
   ExtentReportListener extentReport = new ExtentReportListener();
   TestNG testng = new TestNG();
   testng.setTestClasses(new Class[] {FirstTest.class});
   testng.addListener(extentReport);
   testng.run();
  }
  </code></pre>
  
  <p>Please help me out to pass parameters in main method itself. Let me know if you need more info.</p>