美文网首页
SpringBoot+ Intellj idea devtool

SpringBoot+ Intellj idea devtool

作者: 上进的小二狗 | 来源:发表于2018-08-08 17:51 被阅读0次

一、pom文件

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <!-- optional=true,依赖不会传递,该项目依赖devtools;之后依赖myboot项目的项目如果想要使用devtools,需要重新引入 -->
    <optional>true</optional>
</dependency>

二、project增加

    <build>    
        <plugins>    
            <plugin>    
                <groupId>org.springframework.boot</groupId>    
                <artifactId>spring-boot-maven-plugin</artifactId>    
                <configuration>    
                <!--fork :  如果没有该项配置,可能devtools不会起作用,即应用不会restart -->    
                <fork>true</fork>    
                </configuration>    
            </plugin>    
        </plugins>    
    </build>    

三、idea 设置

1、“File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Make project automatically”
2、按住组合键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running”

四、缓存配置

1、application.properties

spring.thymeleaf.cache=false

2、Chrome禁用缓存

相关文章

网友评论

      本文标题:SpringBoot+ Intellj idea devtool

      本文链接:https://www.haomeiwen.com/subject/ljwjvftx.html