美文网首页虾写Spring
SpringBoot 热部署

SpringBoot 热部署

作者: github加星点进来 | 来源:发表于2017-06-21 10:51 被阅读31次
    spring-boot-devtools
    一、开启idea自动make功能

    1、CTRL + SHIFT + A --> 查找make project automatically --> 选中
    2、CTRL + SHIFT + A --> 查找Registry --> 找到并勾选compiler.automake.allow.when.app.running

    使用spring-boot-1.3开始有的热部署功能

    1、加maven依赖
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <optional>true</optional> <!-- 这个需要为 true 热部署才有效 -->
    </dependency>
    

    第二步只需要在parent 不是spring-boot-starter-parent 的时候才需要配置

    2?、开启热部署
    <build>  
        <plugins>  
            <plugin>  
                <groupId>org.springframework.boot</groupId>  
                <artifactId>spring-boot-maven-plugin</artifactId>  
                <configuration>  
                    <fork>true</fork>  
                </configuration>  
            </plugin>  
        </plugins>  
    </build> 
    
    3?Chrome禁用缓存 , 万一没变的话,清除chrome 缓存

    相关文章

      网友评论

        本文标题:SpringBoot 热部署

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