idea中springboot配置热部署

  1.pom.xml配置依赖:


<dependency>
   <groupId>org.springframework.bootgroupId>
   <artifactId>spring-boot-devtoolsartifactId>
   <optional>trueoptional>
dependency>
2.File->setting->搜索compiler->将Build project automatically打勾
(注意后面only works not running/debugging,如果要实现热部署就必须打破这个限制)

3.CTRL+ALT+SHIFT+/ 组合键打开 Maintenance窗口选择Registry... ,

找到compiler.automake.allow.when.app.running选项,打勾开启运行时编译功能

从此以后!修改Java代码就不需要重新部署啦!


你可能感兴趣的:(idea中springboot配置热部署)