且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Spring Boot无法运行maven-surefire-plugin ClassNotFoundException org.apache.maven.surefire.booter.ForkedBooter

更新时间:2022-01-04 17:45:19

此问题的解决方法是重写Spring Boot的maven-surefire-plugin定义并将useSystemClassLoader设置为false.阅读 Surefire文档以了解更多详情

Workaround for the issue was to override Spring Boot's maven-surefire-plugin definition and set useSystemClassLoader to false. Read Surefire docs for more details

<build>
    <plugins>
        ...
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <useSystemClassLoader>false</useSystemClassLoader>
            </configuration>
        </plugin>
    </plugins>
</build>