title: How to set TestNG in classpath in Maven project?
body: <p>In order to run TestNG tests on command line, I'll have to set TestNG in classpath. To do so, I went through -</p>
  
  <p><a href="https://stackoverflow.com/questions/18800333/unable-to-execute-testng-suite-file-via-command-line">Unable to execute TestNG Suite file via command line</a></p>
  
  <p><a href="https://stackoverflow.com/questions/17894938/getting-error-could-not-find-or-load-main-class-org-testng-testng">Getting error Could not find or load main class org.testng.TestNG</a></p>
  
  <p>which tells that if <code>testng.jar</code> is in <code>lib</code> folder of the project, then do set path until <code>lib</code> folder(like - <code>C:\Workspace\projectname\lib\*</code>) in classpath. </p>
  
  <p>But in my case, I'm using Maven project and hence don't have <code>lib</code> folder to put jars. In this case, how can I set TestNG in classpath? And hence run TestNG tests on command line.</p>