Running JUnit tests with Maven under Eclipse

后端 未结 2 2025
一向
一向 2020-12-15 08:16

I just installed the plugin m2e for the first time on Eclipse.

I wrote a simple JUnit (version 4) test. I can run it from Eclipse, but not from the pom.xml (alt-clic

2条回答
  •  一个人的身影
    2020-12-15 09:10

    you can run Junit 4 with Maven. You just need the Junit 4 dependency in your pom. You also need the surefire plugin to execute the tests.

    See: http://maven.apache.org/plugins/maven-surefire-plugin/

    Hint: By default surefire looks for files with *Test.java naming to find tests.

提交回复
热议问题