zoukankan      html  css  js  c++  java
  • springboot热部署

    1,新建一个web项目

    2,pom.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>com.devtools</groupId>
        <artifactId>springbootdevtools</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <packaging>jar</packaging>
    
        <name>springbootdevtools</name>
        <description>Demo project for Spring Boot</description>
    
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.0.3.RELEASE</version>
            <relativePath/> <!-- lookup parent from repository -->
        </parent>
    
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
            <java.version>1.8</java.version>
        </properties>
    
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
    
    
            <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-devtools</artifactId>
                <version>2.0.3.RELEASE</version>
                <optional>true</optional>
                <!--true才能生效-->
            </dependency>
    
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <scope>test</scope>
            </dependency>
        </dependencies>
    
        <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
            </plugins>
        </build>
    
    
    </project>
    pom.xml

    3,设置自动编译 files--settings--build...--compiler,勾选build project automatically

    4,编写测试

    访问得到hello

    更改返回数据为hello01

    访问得到结果hello01,此时并不需要重启项目

  • 相关阅读:
    LAMP环境搭建
    Centos系统下Lamp环境的快速搭建(超详细)
    主题:Windows系统服务器磁盘挂载
    云硬盘
    独立IP与共享IP的区别
    网站备案的注意事项
    云主机与vps虚拟主机的区别
    vim 命令大全 / vi 命令大全
    【Linux】Linux中常用操作命令
    Linux Shell常用技巧(一) RE
  • 原文地址:https://www.cnblogs.com/guochengfirst/p/springboot.html
Copyright © 2011-2022 走看看