springboot project: to run as -> spring boot app way to start, configure hot deployment (pro-test available !!!)

1. Add hot deployment dependency in pom.xml

<-! Hot deployment ->
<! - page DevTools hot deployment can be achieved (ie after the page changes will take effect immediately, this can be configured directly in the application.properties spring.thymeleaf.cache = false documents to achieve) - >
<-! (do not take effect immediately after the class file modification) implementation class file hot deployment, hot deployment to achieve the properties file. ->
<! - that file in the classpath devtools listens change, and immediately restart the application (place in time to save), Note: because the virtual machine which uses the mechanism, the restart is fast ->
< ! - (1) base classloader ( Base class loader): loading does not change class, for example: jar package provided by third parties. ->
<- (2) the restart ClassLoader (the Restart class loader):! Load Class being developed. ->
<! - Why restart quickly, because only restart when loaded Class in development, without reloading third party jar package. ->
<dependency>
<the groupId> org.springframework.boot </ the groupId>
<the artifactId> Boot-Spring-DevTools </ the artifactId>
! <- = optional to true, dependency is not transmitted, the item dependent DevTools; after-dependent project boot program if you want to use devtools,
need to re-introduce ->
<optional> to true <

2. Configure the hot deployment in application.yml

# Hot deployment into force
spring.devtools.restart.enabled: to true
# Set the restart directory, add the directory files need to restart
spring.devtools.restart.additional-Paths: src / main / the Java

spring.devtools.restart.exclude: the WEB -INF / **

3. Run the project again, just modify things under src / main / java files, such as modifying UserController.java

@Autowired

private UserService userService;

You will find hot deployment started, shots are as follows:

 

 

Guess you like

Origin www.cnblogs.com/curedfisher/p/11815481.html