import org.junit.jupiter.api.Test和import org.springframework.boot.test.context.SpringBootTest报错
import org.junit.jupiter.api.Test和import org.springframework.boot.test.context.SpringBootTest报错
今天遇见了这个bug,创建新的spring项目,运行报错,看过很多人分享的解决方法,简单来说就是IDEA没有下载对应的jar包,你需要做的就是把对应的jar包下载到你的maven本地仓库
首先,你的pom.xml文件中应该有对应的依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
注意:不需要加上版本号
其次,就是下载对应的两个jar包到本地仓库(我直接去下载并放到对应文件夹了,IDEA一直下不了,原因不知)
MAVEN中央仓库地址大全:https://www.jianshu.com/p/1e1116b1ede6
然后Build Project就ok了
最后,如果遇见依赖不存在,可以按照如上方式处理。如果有时间,我会去了解一下,为什么maven的依赖在导入之后会一直飘红的问题,如下:
您可能感兴趣的文章:
import org.junit.jupiter.api.Test和import org.springframework.boot.test.context.SpringBootTest报错
找不到 org.junit.jupiter.api.Test报错
python3.6想使用urllib2包怎么办
解决java.util.ConcurrentModificationException错误办法
被Python3抛弃的那些函数
python怎么查看mat格式的文件
golang不允许循环import问题("import cycle not allowed")
S2SH整合JQuery+Ajax实现登录验证功能实现代码
flask为什么使用蓝图
python3.4怎样安装openpyx