title: executable jar for selenium testng maven project which dont have a main class
body: <p>I have a Selenium TestNG project created with maven.  ``</p>
  
  <ul>
  <li>There is no main class for this prject </li>
  <li>Using TestNg.xml file and the same is configured in pom.xml file.</li>
  <li>Ran 'maven test' from eclispe and the test runs successfully based on the classes defined in testng.xml. no issues here</li>
  <li>Tried the same from command prompt  using <code>mvn test</code> from the project folder and it ran succesfully. no issues here too. </li>
  </ul>
  
  <p>My requirement : Now i want to package this project either to executable jar or are there are any option to make a executable file so that i can schedule the run using a batch file. </p>
  
  <p>To do this I ran the 'mvn package' command and it generated the jar file in the target folder. Now when i try to run this as <code>java -jar myproj-0.0.1-SNAPSHOT.jar</code> i get the message as "no main manifest attribute, in myproj-0.0.1-SNAPSHOT.jar". This is expected behavior since there is no  main class in my case.<br>
   So i created a main class with just one line to print "text" and added the  mainClass below entry in pom.xml</p>
  
  <pre><code>&lt;plugin&gt;
    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
  &lt;version&gt;2.3.2&lt;/version&gt;
  &lt;configuration&gt;
      &lt;archive&gt;
      &lt;manifest&gt;
          &lt;mainClass&gt;mainPackage.MainOne&lt;/mainClass&gt;
      &lt;/manifest&gt;
  &lt;/archive&gt;
  &lt;/configuration&gt;
   &lt;/plugin&gt; 
  </code></pre>
  
  <p>Then i ran mvn package and it generated the new jar. 
  Then went to target folder of my project and ran the command as <code>java -jar myProj.jar mainPackage.MainOne</code>, it ran and just printed "text". MY TestNG tests did not run. It just ran main class :(.. 
  What should i do?</p>