Surefire 2.3 for Maven has been released March 1st.
No big announcements, just a post on the maven mailing list. Still, it is a big deal for me, as I can at last run my JUnit 4 tests with Maven.
Note that your build will not pick up the version by default (at least, it didn’t for me); maybe that’s because I had an older version on my system already? You’ll need to change your pom.xml.
In my case, because I already had JUnit 4 tests and Surefire 2.2 was failing, I had the following lines in my pom.xml:
<plugin> <artifactid>maven-surefire-plugin</artifactid> <configuration> <skip>true</skip> </configuration> </plugin>
To use Surefire 2.3, I had to change it to:
<plugin> <artifactid>maven-surefire-plugin</artifactid> <version>2.3</version> </plugin>
Thanks for this ! – saved me some time this morning.
I met a similar problem here. If my test class name is
****Tests.java it doesn’t work in Maven+Junit4 but works in eclipse+Junit4;
I tested in maven2+junit4, I must use such convention:
****Test.java, No s added. So I must rename all my test classes to such name convention.
It took me many hours to get the point. I thought I’m so stupid.
you can override the convention as show in:
http://maven.apache.org/plugins/maven-surefire-plugin/examples/inclusion-exclusion.html
**/*Tests.java