IDEA报错failed to resolve org.junit.vintage:junit-vintage-engine:5.7.0

原因:是 JUnit使用了 junit-vintage 引擎
junit-vintage 是 Junit 4 中使用的引擎,如果项目使用了 Junit 5 的话,需要在 spring-boot-starter-test 中将 JUnit 4 的引擎排除

 <dependency>
	 <groupId>org.springframework.bootgroupId>
	 <artifactId>spring-boot-starter-testartifactId>
	 <scope>testscope>
	 <exclusions>
	     <exclusion>
	         <groupId>org.junit.vintagegroupId>
	         <artifactId>junit-vintage-engineartifactId>
	     exclusion>
	 exclusions>
dependency>
  • junit-vintage-engine 是 JUnit 4 中使用的测试引擎。
  • junit-jupiter-engine 是 JUnit 5 中使用的测试引擎。

你可能感兴趣的:(环境,后端技术,junit)