Thermal deployment

What is hot deployment

So called hot deployment : Such as the hot deployment of the project , It's when the application doesn't stop , Implement new deployment

Project demonstration case

@RestController

@Slf4j

public class IndexController {

@Value("${itmayiedu}")

private String itmayieduName;

@RequestMapping("/index")

public String index() {

String result = "springboot2.0 V1.0";

log.info("result:{}", result);

return result + itmayieduName;

}

}

Hot deployment principle

spring-boot-devtools It's a module for developers , One of the most important functions is to automatically apply code changes to the latest App The above to . The principle is that after you find that the code has changed , Restart the app , But it's faster than manually stopping and then starting , Faster is not the time saved by hand .

The underlying principle is the use of two ClassLoader, One Classloader Load classes that won't change ( The third party Jar package ), the other one ClassLoader Loading classes that change , be called   restart ClassLoader

, So when there's code change , The original restart ClassLoader To be discarded , Recreate a restart ClassLoader, Because there are fewer classes to load , So it realizes faster restart time (5 Within seconds )

Devtools rely on

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-devtools</artifactId>

<optional>true</optional>

<scope>true</scope>

</dependency>

Devtools principle

1. devtools Will listen classpath Document changes under , And will immediately restart the app ( It happened at the time of preservation ), Be careful : Because of the virtual machine mechanism , The restart is fast .

2. devtools Hot page deployment can be realized ( That is, the page will take effect immediately after modification , This can be directly in application.properties Configuration in file spring.thymeleaf.cache=false To achieve ( Note that different template configurations are different )

SpringBoot- Thermal deployment Devtools More articles about

  1. The first 4 Chapter springboot Thermal deployment 4-1 SpringBoot Use devtools Hot deployment

    /imooc-springboot-starter/src/main/resources/application.properties # Turn off caching , Instant refresh #spring.freemarker.c ...

  2. SpringBoot( 6、 ... and ):springboot Thermal deployment

    stay j2ee Project under development , Hot deployment plug-ins are JRebel.JRebel The use of is a great help to developers , And it's very high. It's easy to develop . And in the SpringBoot In the development of ecological environment ,SpringBoot Common hot deployment plug-ins are :sprin ...

  3. SpringBoot Thermal deployment - Solution

    stay SpringBoot Enabling hot deployment in is a very simple thing , because SpringBoot It provides us with a very convenient tool spring-boot-devtools, We just need to introduce this tool into the project OK 了 , Here I am ...

  4. 【SpringBoot】SpringBoot Hot deployment and automatic injection of configuration files

    ========================3.SpringBoot Thermal deployment devtool And automatic injection of configuration files ============================ 1.SpringBoot2 ...

  5. SpringBoot Hot deployment configuration ( be based on Maven)

    Hot deployment means that as long as the code in the class is modified , It works in real time , Without having to restart the project .spring-boot-devtools It's a module for developers , One of the most important functions is to automatically apply code changes to the latest App The above to . primary ...

  6. SpringBoot Two ways of hot deployment

    SpringBoot There are two ways of hot deployment , Use two different dependencies SpringBoot 1.3 Only after SpringBoot devtools Thermal deployment ①:spring-boot-devtools   ② ...

  7. SpringBoot Hot deployment error (BeanCreationException: Error creating bean with name 'classPathFileSystemWatcher' d)

    springboot Hot deployment configuration method http://blog.csdn.net/pyfysf/article/details/78791292 The exception information is as follows org.springframework.be ...

  8. SpringBoot&quot; heat &quot; Deploy the solution

    author : I forgot the story ¢ WeChat official account : The moon box of procedural apes SpringBoot Hot deployment in two ways 1.SpringLoader plug-in unit ​ shortcoming : Java Code deployment processing . But nothing to do with the page . 2.DevToo ...

  9. springboot Hot deployment settings

    springboot Provides hot deployment , Hot deployment is when you modify the file code , No need to restart the server , And you just have to do it again build The current project can be recompiled with just one click . And that's hot deployment . Actually springboot Hot deployment is through a ...

  10. idea To configure SpringBoot Automatic hot deployment Build

    One .pom.xml File import depends on file SpringBoot Hot deployment plug-in <dependency> <groupId>org.springframework.boot</g ...

Random recommendation

  1. Extjs Center the window , Clear the mouse event of the parent form when the double form pops up

    This is an event that monitors the scaling of the form Center in zoom, mainly in 'beforeshow' and 'destroy' Two events are monitored var EditTempWindow; Ext.EventManager.onWindow ...

  2. common linux Interpretation of orders ( The fourth day )——bash part

    learn linux When , I skipped something very important . Like zoning . also vim Deep learning of . Partition did not learn because I installed a virtual machine , I don't know why , The formatted partition cannot be displayed properly . as for vim, I've learned about the simple addition, deletion and modification . Be able to ...

  3. println() Output function int Type return value error

    out.println(); Use this statement to output other classes and return large int Type of data , Note the output error . for example : out.println(class1. Method ()):  Cause error : our.println(c ...

  4. 017Makefile engineering management

    1. Why Makefile? utilize Makefile and make The cooperation of , A lot of work can be combined into a very simple command :make: make Can make the whole program compile . Links require only one command (make) You can do it ...

  5. POSIX、XNU

    POSIX Represents a portable operating system interface (Portable Operating System Interface , Abbreviation for POSIX ),POSIX The standard defines the interface standard that the operating system should provide for the application , yes IEE ...

  6. ( turn )Android Development : Performance best practices - Manage application memory

    Translated from :http://developer.android.com/training/articles/memory.html In any software development environment ,RAM They are precious resources , But more precious in mobile operating systems . Even though ...

  7. Spire.XLS

    Another paragraph Excel Dealing with artifact Spire.XLS, You deserve it ( Two )   Preface : Part 1  C# Component series —— Another paragraph Excel Dealing with artifact Spire.XLS, You deserve it   Two functions of the next component are introduced , It's not characteristic , But it does solve me ...

  8. Java IO(Properties/ Object serialization / Print stream /commons-io)

    Java IO(Properties/ Object serialization / Print stream /commons-io) Properties Properties Class represents a set of persistent properties .Properties Can be saved in or loaded from a stream . ...

  9. vue Two way data binding and ref obtain dom node

    vue It's a MVVM Framework The business logic code is js Part of it is model part , html yes view part . When model When things change ,view It will change too. view Change is ,model It will change too. <template ...

  10. PM2 To deploy nodejs The server is permanently turned on

    pm2 Daily use   1. pm2 What is it? ? Daily development needs to start a node project , Need to use npm run …,, If the terminal is turned off , The program stops automatically , Sometimes several events run together , Several terminals are on , I don't like it very much , ...