Maven surefire arguments when running JUnit test via eclipse

前端 未结 1 1190
甜味超标
甜味超标 2021-01-12 13:10

A newbie question on Maven - Surefire - Eclipse - JUnit

I have configured the maven-surefire-plugin in the pom file of my project to pass some additional JVM argumen

1条回答
  •  伪装坚强ぢ
    2021-01-12 13:53

    Eclipse JUnit Launcher (choose Run As -> JUnit Test) is a independent test runner which has its own pre-defined build and running life cycle and has nothing to do with Maven, it will not pick up your pom magically and read in the surefire configuration and use them to drive the test running.

    If your project is imported as an existing Maven project, use Maven (choose Run as -> Maven test) launch your JUnit test which will pick up and use the surefire configuration. This is exactly same as running mvn test from commandline, it only output run log in console and you will not able to use the nice red & green JUnit UI window.

    Hope this make sense.

    0 讨论(0)
提交回复
热议问题