Run tests located within a fat maven jar?

  Kiến thức lập trình

I have a maven project which is a test harness including tests.

The tests can be run using surefire, within intelliJ. And the IDE states the command line it is running in order to do this:

java
-Dmaven.multiModuleProjectDirectory=...
"-Dmaven.home=...
"-Dclassworlds.conf=...
"-Dmaven.ext.class.path=...
"-javaagent:... 
-Didea.version=... 
install

If I put the jar on another machine, and wish to run the tests contained within it (ideally with surefire plugin) should I be aiming to construct a similar command line as to the above, or run something like mvn test {jar name} or mvn surefire:test {jar name}

1

LEAVE A COMMENT