最近搜索

springboot实现热部署 sts和idea

浏览:433
管理员 2021-12-23 08:59


image.png

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




添加配置文件

#thymeleaf config
spring.thymeleaf.cache=false
#thymeleafconfig



spring.devtools.restart.enabled=true
spring.devtools.restart.additional-paths=src/main/java
spring.devtools.restart.exclude=WEB-INF/**

image.png


STS使用上面的配置即可。





IDEA需要单独设置这2个东西,才会生效。


当我们修改了类文件后,idea不会自动编译,得修改idea设置。


(1)File-Settings-Compiler-Build Project automatically

(2)ctrl + shift + alt + / ,选择Registry,勾上 Compiler autoMake allow when app running

image.png


联系站长

站长微信:xiaomao0055

站长QQ:14496453