【发布时间】:2018-11-12 16:06:53
【问题描述】:
运行 Spring Boot 2.0.2.RELEASE 应用程序的 maven (3.5.2) 构建(由具有 Web 依赖关系的 Web 初始化程序生成)无法执行 maven-surefire-plugin 只是说:
错误:无法找到或加载主类 org.apache.maven.surefire.booter.ForkedBooter
原因:java.lang.ClassNotFoundException:org.apache.maven.surefire.booter.ForkedBooter
为什么会这样?它是引导中的问题+肯定集成=错误吗?
作为参考,看起来相关的依赖项是:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
<relativePath/>
</parent>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
...
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
【问题讨论】:
-
upstream issue 显示了三个解决方法(此处列出的两个,加上
forkCount0),但没有一个没有问题☹
标签: spring maven spring-boot maven-surefire-plugin