SpringBoot achieve hot deployment (utility version) in the IDEA

Original link: https: //www.jianshu.com/p/f658fed35786

The first step: Turn on the automatic compilation of IDEA (static)

Specific steps: Open the toolbar at the top File -> Settings -> Default Settings -> Build -> Compiler and check Build project automatically.

Step two: Open the IDEA automatic compilation (dynamic)

Specific steps: Hold down Ctrl + Shift + Alt + / and then into the Registry, check and adjust the delay parameters is automatically compiled.

  • compiler.automake.allow.when.app.running -> automatic compilation
  • compile.document.save.trigger.delay -> Automatic Updates file

PS: Online Few people mention compile.document.save.trigger.delay it is mainly for the static files such as JS CSS updates, will reduce the delay time, press F5 to refresh the page will be able to see results

Step 3: Enable IDEA hot deployment strategy (very important)

Specific steps: the top menu -> Edit Configurations-> SpringBoot plug -> Goal Project -> Check the hot update.

Step 4: Add the hot deployment plug-in POM file (optional)

 <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
        </dependency>

Step Five: Close the browser cache

F12's Network options bar, and then check the [✅] Disable cache.

Guess you like

Origin www.cnblogs.com/19322li/p/11247829.html