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>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章