【发布时间】:2018-09-13 08:18:44
【问题描述】:
我的 SpringBootTest 注解无法解析为类型。这里有同样的问题,但似乎添加依赖项
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.0.5.RELEASE</version>
<scope>test</scope>
</dependency>
无法做到这一点。整个问题是我想使用 @ContextConfiguration 但它已被弃用,建议的做事方式是使用 @SpringBootTest(classes = MyMainClass.class)
【问题讨论】:
-
好像
spring-boot-starter-test已损坏,请尝试将其从本地 maven 中删除并重新构建 -
展示你的完整 pom?
标签: java spring maven annotations