springboot + idea 代码修改热部署/加载

身为JAVA程序员,等待代码编译是一件痛苦的事情。况且追求高效是程序员所具有的一种天然品性。

在接触强大的springboot框架过程中,每次修改代码后,都要重新启动。我就想,肯定有方法可以实现代码修改后热加载/部署,果不其然,springboot早已为我们准备了解决方案,且方便快捷。收集了一些资料后,亲身验证,以下方法可行,请参照以下方法设置。(本文以idea 为例子)


第一步: 在pom.xml增加下面依赖

[html] view plain copy
  1. <dependency>  
  2.      <groupId>org.springframework.boot</groupId>  
  3.      <artifactId>spring-boot-devtools</artifactId>  
  4. </dependency>  


第二步: 打开idea ,File->Settings-> Build-Execution-Deployment -> Compiler

勾选 Build Project Automatically




第三步: 按 Shift+Ctrl+A (windows,mac是 command+shift+A) 

将看到弹窗 Enter Action or option name,输入"registry",双击第一项"Registry..." ,会弹出另一个窗口,寻找

compiler.automake.allow.when.app.running
这一项,并勾选开启。然后关闭窗口。





第四步: 重启 IDE

猜你喜欢

转载自blog.csdn.net/qq_29663071/article/details/80061852
今日推荐