Caused by: java.lang.ClassNotFoundException: org.springframework.core.annotation.MergedAnnotations$SearchStrategy
at java.net.URLClassLoader.findClass(URLClassLoader.java:591) ~[na:1.8.0_345]
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:957) ~[na:1.8.0_345]
at java.lang.ClassLoader.loadClass(ClassLoader.java:902) ~[na:1.8.0_345]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) ~[na:1.8.0_345]
at java.lang.ClassLoader.loadClass(ClassLoader.java:885) ~[na:1.8.0_345]
... 27 common frames omitted
原因是spring-boot-test版本不一致:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<version>2.3.1.RELEASE</version>
</dependency>
将spring-boot-starter-parent降到相同版本:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.1.RELEASE</version>
</parent>
注意:本文归作者所有,未经作者允许,不得转载