该问题的解决方法是重写Spring Boot的
maven-surefire-plugin定义并将其设置
useSystemClassLoader为
false。阅读Surefire文档以获取更多详细信息
<build> <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <useSystemClassLoader>false</useSystemClassLoader> </configuration> </plugin> </plugins></build>



