How to run maven jar file with surefire plugin?

I created a maven project to test my application. I used Webdriver, the TestNG platform in my project. I used the maven surefire plugin and the reporty-ng plugin to create a report for test cases. This works great when run in the IDE (eclipse) or command line using the command (mvn test site). Now I have to make it a jar file so that I can put this jar file on any system and run it.

So the problem is:

  • Maven jar does not include the test source and class available in src \ test. we can solve this using the maven jar plugin test bowl
  • Even in any case, I can create a maven jar file, but how to run it, because I do not have the main class, I use the testng.xml set to run my test. I am using testng.xml in configuring the surefire plugin

So how will I run the jar file?

+4
source share
1 answer

I suppose you want your tests to run not only in maven, but also in some other build system (e.g. Ant)?

If so, then I think you need good reports that will tell you how your tests went. If so, you can watch this project: http://reportng.uncommons.org/

ant classpath ref 'test-path', ( )... -

< testng classpathref= " "           OutputDir = "${-results.dir}"           haltonfailure = ""           useDefaultListeners = ""            = "org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter" >     < xmlfileset dir = ". " =" testng.xml "/ >     < sysproperty key =" org.uncommons.reportng.title " value =" "/ >   </TestNG>

0

All Articles