I have the same problem with
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.0.RELEASE</version>
</parent>
This gives me the warning.
WARNING: TestEngine with ID 'junit-vintage' failed to discover tests
java.lang.NoClassDefFoundError
For me, this is important because I have to run both JUnit 4 and JUnit 5 tests. And this warning makes me not able to read JUnit 4 tests.
I tried solutions from all over the internet and I found the solution from
Basically, we need to add
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.8.1</version> <!-- Adjust this with your case -->
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
And don't forget to make the build plugin just like this
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
</plugin>
This makes me able to run both JUnit 4 and JUnit 5 tests 👍
Hope you all don't waste your time like I did. Spent like all day for this 😅