热部署 Devtools:
- Adding devtools to your project
- Adding plugin to your pom.xml
- Enabling automatic build
- Update the value of
- Restart IDEA(不一定需要)
在要热部署的项目中,加入 devtools 的依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
父 pom 中加入插件,并且配置
<build>
<finalName>xxxx</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>
设置自动 build