Intellij IDEA 下 springboot 项目设置全局热部署
1. 导入依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
2. 开启 idea 自动编译功能
打开 Preferences (COMMAND + ,),选中 Build project automatically---> OK
3. 开启 idea 中允许在程序运行过程中交换类加载器
-
Mac 下按 command + option + shift + / (windows 下按 ctrl + alt + shift + /) 打开 Maintenance ,选择 Registry
-
选择 compiler.automake.allow.when.app.running
-
重新启动项目