<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.4.0</version>
<scope>test</scope>
</dependency>
junit-jupiter-engine-5.4.0.pom依赖项是
<dependency>
<groupId>org.apiguardian</groupId>
<artifactId>apiguardian-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-engine</artifactId>
<version>1.4.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.4.0</version>
<scope>compile</scope>
</dependency>
但是我运行mvn dependency:tree
,结果是这样的:
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.4.0:test
[INFO] | +- org.apiguardian:apiguardian-api:jar:1.0.0:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.3.2:test
[INFO] | | +- org.junit.platform:junit-platform-commons:jar:1.3.2:test
[INFO] | | \- org.opentest4j:opentest4j:jar:1.1.1:test
[INFO] | \- org.junit.jupiter:junit-jupiter-api:jar:5.3.2:test
生成工具:maven3.5.4
答案 0 :(得分:0)
这是Gradle 5 JUnit BOM and Spring Boot Incorrect Versions的副本。
解决方案是将以下内容添加到您的Maven POM中。
<properties>
<junit-jupiter.version>5.4.0</junit-jupiter.version>
</properties>
答案 1 :(得分:0)
在将spring boot依赖关系更新到最新版本并将Juiper引擎版本更新到5.6.1之后,我也遇到了类似的问题。
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.1</version>
<scope>test</scope>