We've had it so, so often. Junit 5 is a bitch to run in maven. First there were issues with the surefire plugin. Make sure that is updated. Then there were issues with the versions you need to use together. Whelp, that was all set up right. And of course... still no junit 5 A fun thing was seeing this: [INFO] --- maven-surefire-plugin:3.1.2:test (default-test) @ my-project --- [INFO] Using auto detected provider org.apache.maven.surefire.junit4.JUnit4Provider Yeah, that's not how it should go. This forces the junit 4 provider... Which is not the junit 5 generic one. After a lot of digging, it turns out that surefire determines which provider to use... through some magic from the classpath. Of course, nowhere is there a junit4 dependency. They're all gone. Well... Except... Except... The platform dependency < dependency > < groupId >org.junit.platform</ groupId > < artifactId >junit-platform-launcher</ artifactId > < version ...
This is a simple blog to help me remember those cool code snippets which I used. Either by copy, or by cobbling... I do not intend this to be read by people except for me and my bad mind.