springboot hot deployment

Tools: Idea 2017

jar包:

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-devtools</artifactId>
   <!-- optional=true, dependencies will not be passed, the project depends on devtools;
      If the project that depends on the boot project wants to use devtools, it needs to be re-introduced -->
   <optional>true</optional>
</dependency>

application.properties (.yml) placement:

# Hot deployment takes effect
spring.devtools.restart.enabled=true
#Set the restart directory, adding files in that directory requires restart
spring.devtools.restart.additional-paths=src/main/java
#Close the cache, refresh immediately (select the template you use according to the template)
#spring.freemarker.cache=false
#spring.thymeleaf.cache=true
#Exclude files in that directory without restart (the following two configurations can be added according to your own needs)
#spring.devtools.restart.exclude=static/**,public/**
The contents of the WEB-INF folder in the #classpath directory are modified without restarting
#spring.devtools.restart.exclude=WEB-INF/**

If there is a problem that the hot deployment is successful but the front desk does not refresh, you must pay attention to whether the tool you are using is an idea. If so, please see ↓↓↓ and see the picture for modification.


If the image above is not found:

2. Key combination: Shift+ALT+Ctrl+/ , select "Registry", press Enter, find "complier.automake.allow.when.app.running" 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324833839&siteId=291194637