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

IntelliJ IDEA 2012.2.1版本下Spring Boot Devtools失效如何解决

注:你所述的2012.2.1应为笔误,下述解决方案针对2022.2.1版本适配。

关于配置项是否移除的说明

IntelliJ IDEA 2021.2及以上版本已经移除了旧版本中需要在Registry中修改的compiler.automake.allow.when.app.running配置项,该功能已迁移到高级设置面板中,并非配置被删除。

热更新生效操作步骤
  • 确认Spring Boot DevTools依赖正确引入
    Maven项目pom.xml添加配置:
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
        <optional>true</optional>
    </dependency>
    
    Gradle项目build.gradle添加配置:
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    
  • 开启IDE自动构建
    打开路径 File > Settings > Build, Execution, Deployment > Compiler,勾选 Build project automatically 选项。
  • 开启运行时自动构建权限
    打开路径 File > Settings > Advanced Settings,在Compiler分类下勾选 Allow auto-make to start even if developed application is currently running,该配置即为旧Registry配置的替代项。
  • 配置启动项更新策略
    打开当前使用的Spring Boot启动配置,修改两个参数:
    • On 'Update' action 选择 Update classes and resources
    • On frame deactivation 选择 Update classes and resources
      保存配置后重启启动的项目即可生效。
  • 检查项目本地配置
    确认项目的application.properties或application.yml中没有配置spring.devtools.restart.enabled=false,同时检查spring.devtools.restart.exclude配置是否错误排除了你修改的代码路径。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.05 17:27:05