1. 首页
  2. 软件工具

idea社区版(2023.1)设置spring boot项目热启动

热启动 在开发过程中,当写完一个功能我们需要运行应用程序测试时需要重启服务器,一个最简单的项目也要花费10多秒,如果是更大的项目则耗时更多。SpringBoot提供了spring-boot-devtools,使得项目在发生改动时能够自动重启应用

idea社区版设置 菜单栏FIle->Settings… ————————————————

image.png

勾选Build project automatically

菜单栏FIle -> Settings… -> Advanced Settings

image.png

勾选Allow auto-make to start even if developed application is currently running

maven包配置

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
    <scope>runtime</scope>
</dependency>

配置文件

新增

spring.devtools.restart.enabled=true
image.png

成功!


TOP