本篇旨在编码过程中更加灵活,方便去修改代码,避免了idea重复启动造成不必要的时间等待!
文章目录
1. 添加devtools到你的工程中
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
2.添加插件到pom.xml中(微服务可以添加到父pom中)
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>
3. 开启idea自动编译构建
4.开启热注册更新值
组合键:
ctrl+shift+Alt+/