gpt4 book ai didi

spring-boot - 使用 maven-failsafe-plugin spring-boot 1.4 进行集成测试时出现 TypeNotPresentExceptionProxy 错误

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

我收到 ArrayStoreException : TypeNotPresentExceptionProxy 使用 maven-failsafe-plugin 和 spring-boot 1.4 运行集成测试时。

如果你运行 joinfaces-example 你会看到这个错误和

mvn -Pattach-integration-test 全新安装

我意识到如果我将 spring-boot-maven-plugin 更改为在 上运行,则不会发生错误预集成测试相而不是 包裹一。

此外,当我将 spring boot 升级到 1.4 时,这个错误就开始了。如果我将 jsf-spring-boot-parent 版本更改为使用 spring boot 1.3 版本的 2.0.0,则不会发生错误。

最佳答案

我实际上在 Spring Boot 1.4 release notes 中找到了答案,简短的回答是 maven-failsafe-plugin 与 Spring Boot 1.4 不兼容的新可执行布局。完整解释如下:

As of Failsafe 2.19, target/classes is no longer on the classpath and the project’s built jar is used instead. The plugin won’t be able to find your classes due to the change in the executable jar layout. There are two ways to work around this issue:

  • Downgrade to 2.18.1 so that you use target/classes instead

  • Configure the spring-boot-maven-plugin to use a classifier for the repackage goal. That way, the original jar will be available and used by the plugin. For example :


<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>

关于spring-boot - 使用 maven-failsafe-plugin spring-boot 1.4 进行集成测试时出现 TypeNotPresentExceptionProxy 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38726347/

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