1

I have a .jar file, where I have packaged my maven managed java project which has few Junit test cases as well. Now I want to run test cases from my .jar file. For example, from the source code mvn test will run the test cases, but it is not working for .jar file.

How do I run Junit test cases from my .jar file?

Arry
  • 1,630
  • 9
  • 27
  • 46
  • What's wrong with the surefire plugin? – Gimby Mar 12 '14 at 16:48
  • similar question is answered here: http://stackoverflow.com/questions/10496846/run-junit-tests-contained-in-dependency-jar-using-maven-surefire/17061755#17061755 – galusben Jul 30 '14 at 11:02

1 Answers1

0

You need to configure the maven-jar-plugin, and include the test classes in the jar

http://maven.apache.org/plugins/maven-jar-plugin/usage.html

have a look also here http://maven.apache.org/plugins/maven-jar-plugin/test-jar-mojo.html

Vargan
  • 1,277
  • 1
  • 11
  • 35