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

Quarkus Qute模板引擎频繁报错,需执行mvn clean重启求助

解决Quarkus Qute模板引擎"Parameter names not recorded"报错问题

针对你遇到的Qute模板引擎频繁抛出Parameter names not recorded错误,即使已配置maven-compiler-plugin的<parameters>true</parameters>,仅靠mvn clean无法彻底解决的问题,可按以下步骤排查修复:

  • 验证编译参数是否实际生效
    编译项目后,用javap -v com.projects.terminplaner.app.resources.ConfirmationResource$Templates命令查看生成的class文件,检查是否包含MethodParameters属性。如果没有,说明编译参数未正确应用到该类。

  • 强制清理Quarkus开发模式缓存
    Quarkus dev模式的增量编译缓存可能留存了未带参数信息的旧class文件,可直接删除target/quarkus-dev-cache目录,或启动dev模式时添加--clean参数:

    mvn quarkus:dev --clean
    

    这会强制清理缓存并重新编译所有类,避免旧文件干扰。

  • 确保嵌套类的编译参数覆盖
    报错涉及的是嵌套类ConfirmationResource$Templates,需确认maven-compiler-plugin的配置是否全局生效,没有被模块配置或其他插件覆盖。可在pom.xml的<build>根节点下配置编译器插件,而非仅在某个profile中。

  • 升级maven-compiler-plugin版本
    当前使用的3.13.0版本对Java21的兼容性可能存在小问题,建议升级到最新稳定版(如3.14.0),更新pom.xml中的compiler-plugin.version:

    <compiler-plugin.version>3.14.0</compiler-plugin.version>
    
  • 检查IDE编译设置
    若使用IDE(如IDEA)自动编译,需确保IDE也启用了-parameters编译参数:

    • IDEA:进入Build, Execution, Deployment > Compiler > Java Compiler,勾选"Store information about method parameters (usable via reflection)"
    • Eclipse:进入Window > Preferences > Java > Compiler,勾选"Store method parameter names"
  • 排查Quarkus已知问题
    该错误可能是Qute增量编译的已知bug,可确认Quarkus 3.15.1是否存在相关问题,若为已知bug,可临时用--clean启动dev模式作为临时解决方案,等待官方修复。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.17 10:27:39