答案 0 :(得分:1)
因为要在pom.xml中导入弹簧测试工件 然后尝试导入spring包类
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
尝试添加
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>