我用的前端是thymeleaf模板,后台的java,前后台代码修改之后ctrl+s,然后刷新界面都可以做到热部署。
设置
1、command + , --> Build,Execution,Deployment --> Compile --> 选中
image.png2、command + SHIFT + A --> 查找Registry --> 找到打钩compiler.automake.allow.when.app.running
image.png修改pom
添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
添加插件
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.5.RELEASE</version>
</dependency>
</dependencies>
</plugin>
网友评论