IDEA for Mac 2022.1.1版本利用DevTools热部署
spring-boot-devtools 是 Spring Boot 提供的开发者工具,它会监控当前应用所在的 classpath 下的文件发生变化,进行自动重启。
注意,spring-boot-devtools 并没有采用热部署的方式,而是一种较快的重启方式。
在项目中,我们需要在 pom.xml 中,引入 spring-boot-devtools 依赖如下:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency>
具体操作参考:Mac上Intellij IDEA使用spring-boot热部署
需要注意的是在进行热部署配置时,如果发现没有compiler.automake.allow.when.app.running,是因为2021之后的版本被迁移到了这里:

浙公网安备 33010602011771号