Home >Java >JavaBase >Detailed explanation of Spring Boot hot deployment Devtools

Detailed explanation of Spring Boot hot deployment Devtools

Guanhui
Guanhuiforward
2020-07-24 17:19:332440browse

Detailed explanation of Spring Boot hot deployment Devtools

1 pom.xml file

Note: The hot deployment function is available starting from spring-boot-1.3

<!--添加依赖-->
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-devtools</artifactId>
  <!-- optional=true,依赖不会传递,该项目依赖devtools;之后依赖myboot项目的项目如果想要使用devtools,需要重新引入 -->
  <optional>true</optional>
</dependency>

Note: Add spring-boot-maven-plugin to the project, which is mainly used in eclipse. There is no need to add this configuration to the idea.


<build>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <configuration>
        <fork>true</fork>
      </configuration>
    </plugin>
  </plugins>
</build>

2 Change the idea configuration

 1) “File” -> “Settings” -> “ Build,Execution,Deplyment" -> "Compiler", select "Build project automatically".

 2) Key combination: "Shift Ctrl Alt /", select "Registry", check "compiler.automake.allow.when.app.running".

3 Chrome disables cache

F12 or "Ctrl Shift I", open the developer tools, select "Disable Cache (while DevTools is open)" under the "Network" tab

Recommended tutorial: "Java Tutorial"

The above is the detailed content of Detailed explanation of Spring Boot hot deployment Devtools. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete