0
votes

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?

1
What's wrong with the surefire plugin? - Gimby
similar question is answered here: stackoverflow.com/questions/10496846/… - galusben

1 Answers

0
votes

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