Doorgaan naar hoofdcontent

Posts

Posts uit 2023 tonen

Junit 5 never runs in maven

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 ...