十一、Spring Boot熱部署

1.Spring Boot熱部署簡介

 

2.Spring Boot熱部署程序

 

 

3.Spring Boot熱部署

(1).建立工程

(2).引入pom文件

<dependency>html

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

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

   <scope>runtime</scope>app

   <optional>true</optional>spring-boot

</dependency>測試

(3).測試熱部署

  修改後的只須要從新Build->Build Project便可,或者快捷鍵Ctrl+F9ui

package com.hosystem.deploy.controller;spa

 

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

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

 

@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>

相關文章
相關標籤/搜索