SpringBoot project configuration hot deployment startup and hot deployment failure problem solving

There is a personal public account at the bottom of the article: Xiao Zheng who loves technology. Mainly share development knowledge, if you are interested, you can pay attention. Why share? There is no need for others to step on the pits that have been stepped on, and replaying the game by yourself can also deepen the memory. Self-interest and others, the so-called win-win situation.

                                                                              Xiao Zheng who loves technology

Preface

When working on some projects, modify some pages. If you want to see the modified page changes, you need to recompile and restart the project. A lot of time is wasted virtually. Next, I will introduce how to make the modified content and check the changes of the modified content without restarting the project.

Hot deployment steps

1.Configure pom file

Add hot deployment dependencies to the pom file

        <!--热部署-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>

2. IDEA settings modification

The first step: setting -> compiler, check a few

insert image description here

Step 2: Shortcut keyscrtl + alt + shift + /
insert image description here

insert image description here

3. Configuration file modification

  devtools:
    restart:
      enabled: true  #设置开启热部署
      additional-paths: src/main/java #重启目录
      exclude: WEB-INF/**  #排除文件(不重启项目)
  freemarker:
    cache: false    #页面不加载缓存,修改即时生效

4. IDEA startup settings

insert image description here

Guess you like

Origin blog.csdn.net/weixin_43304253/article/details/132741213