【SpringAll】2. SpringBoot 项目快捷开发

SpringBoot 开启热部署

热部署可以在保存后自动更新视图页面。

原本修改完项目 html,需要保存再重启,热部署节约了时间,加快了开发效率,避免无意义的时间消耗。

导入步骤

  1. 导入依赖到 pom.xml:
<!-- SpringBoot工程实现热部署 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
  1. 修改配置项:

在 File-Setting-Build-Compiler中,如图点击两个√:

  1. 按住 Ctrl + alt + shift + / ,选择registry,然后找到compiler.automake.allow.parallel,√一下即可,如下图:

  1. 在配置文件中:
# 热部署生效
spring.devtools.restart.enabled= true
# 设置重启的目录
# spring.devtools.restart.additional-paths= src/main/java
# classpath目录下的WEB-INF文件夹内容修改不重启
# spring.devtools.restart.exclude= WEB-INF/**
  1. 谷歌应用商城下载可自动刷新的插件 LiveReload

结束语

🏃 Be better than before, never stop thinking!

参考

https://blog.csdn.net/assiduous_me/article/details/100663140

posted @ 2021-09-25 23:01  acchris  阅读(103)  评论(0)    收藏  举报