首页 > 编程语言 > 详细

IDEA中Spring boot配置热部署无效问题解决方式(转)

时间:2018-05-09 18:34:54      阅读:131      评论:0      收藏:0      [点我收藏+]
IDEA中Spring boot配置热部署无效问题解决方式

该配置方式属于通过配置devtools实现热部署

只要在pom文件中添加下面代码段即可

<!-- 热部署 -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-devtools</artifactId>
      <optional>true</optional>
      <scope>true</scope>
    </dependency>

----------------------------------------------------


<build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
          <!-- 没有该配置,devtools 不生效 -->
          <fork>true</fork>
          <addResources>true</addResources>
        </configuration>
      </plugin>
    </plugins>
  </build>

但是配置好无效,下面需要修改idea中的两个配置

  1. setting –> compiler
    将 Build project automatically 勾选上
  2. alt + shift + a 搜索 registry 选第一个,弹出框后下拉找到 compiler.automake.allow.when.app.running 勾选上即可。

热部署无效问题已解决。

IDEA中Spring boot配置热部署无效问题解决方式(转)

原文:https://www.cnblogs.com/yasepix/p/9015774.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!