Java – running JUnit tests using Maven under eclipse

I have just installed the plug-in M2e for the first time on eclipse

I wrote a simple JUnit (version 4) test I can run it from eclipse, but not from POM XML (ALT click, run as, Maven test) I think I need to tell Maven to find that class, but I just don't know how

In addition, I can't find JUnit 4 in groupid "JUnit": only version 3.8 1 available I really need it for 3 Writing tests for version x instead of version 4?

How to solve this problem?

Think of me as a bride with Maven: that's what I am So please don't talk about craft skills unless I correctly state what I need to do I hardly installed guava as a dependency, and I completely lost these concepts

thank you!

Solution

You can run JUnit 4 with Maven You only need JUnit 4 dependency in your POM

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

Tip: by default, surefire will find the with * test Java named file to find the test

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>