一、pom的依赖直接添加坐标。
<!-- 热部署 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>provided</scope> <!--optional我没弄明白,都说必须为true,但我测试true,false,不加都可以--> <optional>true</optional> </dependency>
一、pom依赖热部署jar
二、pom开启热部署插件
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> </configuration> </plugin> </plugins> </build>
三、
(1)设置Idea Ctrl+Alt+S
Compiler --> Build project automaticaliy勾选
(2)Ctrl+Shift+Alt+ /
Registry... --> comiler .automake.allow.when.app.running 勾选