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,此时并不需要重启项目

  • 相关阅读:
    我好久没在这上面写东西了,一部分东西都放到有道云笔记上了
    bootstrop 瀑布流
    css3瀑布流
    简洁瀑布流
    Nginx配置文件nginx.conf中文详解
    CSS选择器详解
    CSS3制作各种形状图像
    wen zi gun dong
    下拉菜单
    div
  • 原文地址:https://www.cnblogs.com/guochengfirst/p/springboot.html
Copyright © 2011-2022 走看看