idea热部署 之 devtools
1. 添加 jar 包
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
2. 添加插件
如果是聚合项目,此插件可以添加到父工程的 pom.xml 文件中
<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. 开启自动编译
打开 Settings 配置:
4. 开启热注册
Ctrl+Shift+Alt+/,然后点击:Registry
下面两项打上√