Environment: idea 2019.2
The introduction of pom-dependent:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <!--热部署--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency>
YML 配置:
Spring: MVC: # "spring.mvc.static-path-pattern" for explaining an HTTP request address, the non-requesting controller address, such as js, css, img access paths need to add other static # and "spring.resources.static- locations "is used to describe the storage location of the static resources. A plurality of paths (separated by commas) in order to find whether there is a # static-path-pattern: / static / ** Resources: static -locations: CLASSPATH: / static / , File: D: \\ Thymeleaf: Cache: to false prefix: the CLASSPATH: / Templates / suffix: .html the MODE: HTML5 encoding: UTF -8 # hot deployment DevTools: restart: # whether to enable restart enabled: to true # Setting a reboot directory Additional-Paths: src / main / the Java # the WEB-INF file in the classpath directory folder contents modification does not restart spring.devtools.restart.exclude: the WEB-INF / ** # configuration file specifies program # Profiles: dev
五、File->settings->Build,Execution,Deployment->Complier:勾选Build project automatically -> apply ->ok
六、shift + alt + ctrl + /