SpringBoot开启热部署

       前言

        使用SpringBoot默认是不支持jsp、html网页解析的,如果需要开发web项目就必须导入thymeleaf模板依赖


让SpringBoot支持热部署
  • 在 pom.xml 中加入支持热部署的依赖

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-devtools</artifactId>
      <optional>true</optional>
    </dependency>

之后在 pom.xml 的插件中加入下图中所示的配置,用于 开启热部署。

upload successful

到 tomcat 中设置两个选项:点击“Update”按钮和窗口失去焦点时自动更新新的 class和静态资源文件。

upload successful

File > Settings设置

upload successful

组合键:“Shift+Ctrl+Alt+/”,选 择 “Registry”,选中打勾“compiler.automake.allow.when.app.running”,表示程序运行时也允许自动编译代码。

upload successful