天天看点

最简单最强大的spring-boot热部署--JRebel

1.settings--->plugins-->搜索JRebel---->安装/更新

2.settings--->JRebel--->active

idea中免费永久jrebel 激活:

     http://139.199.89.239:1008/88414687-3b91-4286-89ba-2dc813b107ce

    后面的guid(88414687-3b91-4286-89ba-2dc813b107ce)随便找一个网站生成一个即可。这个:https://www.guidgen.com/

激活后:

1、设置项目自动编译 

2、

ctrl+shift+A 或者 help->find action…打开 

设置 compiler.automake.allow.when.app.running 

搜索registry 

找到 compiler.automake.allow.when.app.running 并勾上

3.(可以用上,不用也行)

<!--热部署-->

<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>

            <!--fork :  如果没有该项配置,肯定devtools不会起作用,即应用不会restart -->

            <fork>true</fork>

         </configuration>

      </plugin>

   </plugins>

</build>