gpt4 book ai didi

spring-boot - 将 Spring Boot 升级到 2.4.2 时 org.springframework.test.context.TestContextAnnotationUtils 上的 ClassNotFoundException

转载 作者:行者123 更新时间:2023-12-03 20:45:41 24 4
gpt4 key购买 nike

在我的 POM 中,我将 Spring Boot 的版本从 2.3.5.RELEASE 升级到 2.4.2。结果,mvn clean test现在失败并出现错误

java.lang.NoClassDefFoundError: org/springframework/test/context/TestContextAnnotationUtils
Caused by: java.lang.ClassNotFoundException: org.springframework.test.context.TestContextAnnotationUtils
在一个简单的测试中
package ch.ge.ael.enu.mediation;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class MediationApplicationTests {

@Test
void contextLoads() {
}

}
有人有线索吗?

最佳答案

为我解决这个问题的是升级我的 spring-test 来自 5.2.9.RELEASE 的依赖版本至 5.3.8

关于spring-boot - 将 Spring Boot 升级到 2.4.2 时 org.springframework.test.context.TestContextAnnotationUtils 上的 ClassNotFoundException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65807150/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com