Idea中Maven项目修改代码自动重启
- 在pom.xml文件中添加jar包依赖
代码如下:
<dependency>
<groupId> org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
2.在application.yml配置文件中添加
#哪些文件需要自动重启
spring.devtools.restart.additional-paths=src/main/java
#哪些文件不需要自动重启
spring.devtools.restart.exclude=static/**,public/
- 打开File->settings->build,execution,deployment->compiler->勾选build project automatically,点击ok保存即可。
3. 设置热部署compiler.automake.allow.when.app.running