intellij中springboot热部署

1、开启idea自动make功能 spring

一、CTRL + SHIFT + A --> 查找make project automatically --> 选中 浏览器

二、CTRL + SHIFT + A --> 查找Registry --> 找到并勾选compiler.automake.allow.when.app.running 缓存

最后重启idea app

2、使用spring-boot-1.3开始有的热部署功能 
一、加maven依赖maven

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
</dependency>

二、开启热部署ide

复制代码

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <fork>true</fork>
            </configuration>
        </plugin>
    </plugins>
</build>

复制代码

3、Chrome禁用缓存 
F12(或Ctrl+Shift+J或Ctrl+Shift+I)--> NetWork --> Disable Cache(while DevTools is open) spring-boot

至此,在idea中就能够愉快的修改代码了,修改后能够及时看到效果,无须手动重启和清除浏览器缓存ui

相关文章
相关标签/搜索