idea 安装 Jrebel 插件
1、【File】 -> 【Settings】 -> 【Plugins】 -> 【Marketplace】,在搜索框中输入 Jrebel,选择 【Install】
2、获取GUID:https://jrebel.qekang.com/,复制GUID:【http://jrebel.qekang.com:80/915246eb-bfc1-49a7-baba-94053f2517bc】
3、激活:
4、设置离线模式,防止失效:【File】->【Settings】->【JReble】->【Work offline】
5、使用说明,官方文档:https://www.jrebel.com/products/jrebel/quickstart/intellij#server-configuration
通过 DevTools 工具实现热部署
1、修改pom.xml文件:
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><scope>runtime</scope><optional>true</optional></dependency><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><fork>true</fork></configuration></plugin></plugins></build>
2、配置Idea:
- 开启自动编译:File > settings > Build,Execution,.. > Compiler > Build project automatically
- 设置Idea的Registry:
- 快捷键:Ctrl + Shift + Alt + “/“
- 选择第一项 “Registry”
- 勾选 compiler.automake.allow.when.app.running
- 重启 idea
