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

热启动

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

idea社区版设置

菜单栏FIle->Settings…
在这里插入图片描述
勾选Build project automatically

菜单栏FIle -> Settings… -> Advanced Settings
在这里插入图片描述
勾选Allow auto-make to start even if developed application is currently running

maven包配置

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-devtools</artifactId>
</dependency>

配置文件

新增
spring.devtools.restart.enabled=true
在这里插入图片描述

成功!

猜你喜欢

转载自blog.csdn.net/artistkeepmonkey/article/details/131923261
今日推荐