11、Spring Boot热部署

1.Spring Boot热部署简介

 

2.Spring Boot热部署程序

 

 

3.Spring Boot热部署

(1).创建工程

(2).引入pom文件

<dependency>

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

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

   <scope>runtime</scope>

   <optional>true</optional>

</dependency>

(3).测试热部署

  修改后的只需要重新Build->Build Project即可,或者快捷键Ctrl+F9

package com.hosystem.deploy.controller;

 

import org.springframework.web.bind.annotation.GetMapping;

import org.springframework.web.bind.annotation.RestController;

 

@RestController

public class HelloController {

 

    @GetMapping("/abc")

    public String hello(){

        return "hello";

    }

}

templates/hello.html

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <title>Title</title>

</head>

<body>

    <h1>hello</h1>

 

</body>

</html>

 

posted @ 2020-11-29 00:52  HOsystem  阅读(101)  评论(0编辑  收藏  举报