在idea里面如何对spring boot项目进行热部署

来源:互联网 发布:sai mac打不开 编辑:程序博客网 时间:2024/05/17 04:42

1 打开idea,用快捷键Ctrl+shift+A.搜索make project automatically.选中,显示相应的设置,勾选红色箭头的选项


2 在Ctrl+Shift+A,搜索register,找到并勾选compiler.automake.allow.when.app.running

3关闭idea,然后再启动

4.添加spring boot的热部署依赖

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

5开启热部署

<build>        <plugins>            <plugin>                <groupId>org.springframework.boot</groupId>                <artifactId>spring-boot-maven-plugin</artifactId>                <configuration>                    <fork>true</fork>                </configuration>            </plugin>        </plugins>    </build>
6 谷歌浏览器禁用缓存

F12---->network--->勾选disable catche