Springboot配置热部署

it2022-06-26  90

一、添加spring提供的devtools热部署依赖

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

二、热部署生效:在配置文件application.yml中添加 :

debug: true spring: devtools: restart: enabled: true #设置开启热部署 freemarker: cache: false #页面不加载缓存,修改即时生效

三、idea启动设置更新class文件


最新回复(0)