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

引入thymeleaf-extras-springsecurity5依赖报错,求排查方案

解决thymeleaf-extras-springsecurity依赖找不到的问题

你的问题核心在于依赖版本与Spring Boot版本不兼容,同时存在依赖artifactId错误:

  • 你使用的Spring Boot 3.0.0配套Spring Security 6.x,但你引入的thymeleaf-extras-springsecurity5是适配Spring Security 5.x的版本,两者不匹配。
  • 报错中显示找不到org.thymeleaf.extras:thymeleaf-extras-springsecurity:pom:unknown,是因为Maven仓库不存在这个无版本后缀的artifactId,适配Spring Boot 3的正确artifactId是thymeleaf-extras-springsecurity6。

修复步骤:

  1. 修改pom.xml中的对应依赖,替换artifactId:
<dependency>
    <groupId>org.thymeleaf.extras</groupId>
    <artifactId>thymeleaf-extras-springsecurity6</artifactId>
</dependency>
  1. 刷新Maven依赖:在IDEA右侧Maven面板点击刷新按钮,或者执行命令:
mvn clean install -U

完成后依赖即可正常加载。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.08 21:55:14