在IDEA中Spring boot配置熱部署無效問題解決方式

在IDEA中Spring boot配置熱部署無效問題解決方式

2018年04月04日 10:10:22 pj小小碼農 閱讀數:2072spring

 版權聲明:本文爲博主原創文章,未經博主容許不得轉載。 https://blog.csdn.net/qq_20989105/article/details/79813413app

只要在pom文件中添加下面代碼段便可eclipse

<!-- 熱部署 -->
<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>

這樣配置在myeclipse中已經能夠實現熱啓動,可是在idea中配置好無效,下面須要修改idea中的兩個配置maven

  1. setting –> compiler ,將 Build project automatically 勾選上
  2. alt + shift + a 搜索 registry 選第一個,彈出框後下拉找到compiler.automake.allow.when.app.running 勾選上便可。

熱部署無效問題已解決。ide

相關文章
相關標籤/搜索