在编写程序时,我们需要将项目启动才能看到修改后的结果,但是每一次修改都需要重新启动是非常麻烦的,所以我们需要配置热部署。

    所谓热部署,就是在应用正在运行的时候升级软件,却不需要重新启动应用。对于Java应用程序来说,热部署就是在运行时更新Java类文件。

配置方法

  1.在项目的中导入包

    在build.gradle文件中添加包

    

compile("org.springframework.boot:spring-boot-devtools:1.5.9.RELEASE") 

 Spring Boot 热部署(IDEA与Gradle)

  2.设置

  按“Ctrl+Shift+A”,弹出窗口,输入“Registry”

  Spring Boot 热部署(IDEA与Gradle)

  点击“Registry”,勾选“compiler.automake.allow.when.app.running”

  Spring Boot 热部署(IDEA与Gradle)

 

 

  然后File--》Settings,找到Compiler,勾选“Build project automatically”

  Spring Boot 热部署(IDEA与Gradle)

 

     到这里,部署就全部完成了。

 

 

 

 

  

相关文章:

  • 2021-04-15
  • 2021-05-30
  • 2021-11-27
  • 2022-01-12
  • 2021-08-15
  • 2021-11-25
  • 2021-07-05
猜你喜欢
  • 2021-07-07
  • 2021-06-13
  • 2022-01-12
  • 2021-07-22
  • 2022-01-04
  • 2021-06-24
  • 2021-11-26
相关资源
相似解决方案