You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级Spring Boot 3.1后maven-enforcer-plugin 3.3.0依赖范围校验异常

Spring Boot 3.1升级后maven-enforcer-plugin 3.3.0构建失败的解决方案

问题场景

  • 升级Spring Boot至3.1版本时,maven-enforcer-plugin被间接升级到3.3.0版本,导致构建失败
  • 项目配置禁止compile范围的org.apache.tomcat.embed类依赖,已手动将tomcat-embed-el的scope设置为test,但插件仍报错,检测到spring-boot-starter-validation传递引入的该组件处于禁止状态
  • 尝试配置<searchTransitive>false</searchTransitive>会完全忽略所有传递依赖的检测,无法管控最终产物的依赖内容

可行解决方案

  • 将maven-enforcer-plugin降级至3.1.0版本,既可以恢复正常构建,又能保留对依赖范围的管控能力

内容的提问来源于stack exchange,提问作者banterCZ

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 11:34:56