Spring-boot realized hot deployment

First, the use of Spring Loader achieve

1) based on maven Start: add dependencies in pom.xml

      1.       <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>springloaded</artifactId>
                        <version>1.2.6RELEASE</version>
              </dependency>
      2.cd到pom.xml目录 :mvn spring-boot:run
2)run as - java applicaton
       1.下载springloaded.jar,放到某一路径(比如放到D盘);
        2.项目右键-》run as->run configuration->Arguments->
                    vm arguments输入  -javaagent:D:\springloaded-1.2.6.RELEASE.jar  -noverify
                    ->apply->run->运行项目即可

Second, the use of spring-boot-devtools implemented

  pom.xml直接添加依赖:
              <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-devtools</artifactId>
                    <optional>true</optional>
               </dependency>

Third, the hot deployment template

   在application.properties中关闭模板引擎的缓存
        spring.thymeleaf.cache = false
        spring.freemarker.cache = false
        spring.groovy.template.cache = false
        spring.velocity.cache = false

Four, JRebel

    是java开发热部署的最佳工具,为收费软件,可以试用14天。
            安装:打开EclipseMarketPlace-》检索JRebel,并安装
            配置使用:注册试用-》选定spring boot增加JRebel功能。
Published 20 original articles · won praise 1 · views 225

Guess you like

Origin blog.csdn.net/qq_33670157/article/details/104497146