springboot+thymleaf热部署

依赖

 <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.5.3</version>
        </dependency>


        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.22</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <!--thymleaf处理localdatetime, "${#temporals.format(teacher.register, 'yyyy年MM月dd日 HH时mm分ss秒')}"-->
        <dependency>
            <groupId>org.thymeleaf.extras</groupId>
            <artifactId>thymeleaf-extras-java8time</artifactId>
            <version>3.0.4.RELEASE</version>
        </dependency>
		<!-- 热部署 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork>  <!--dev-tools相关-->
                    <skip>true</skip>   <!--否则模块打包时候会提示 unable to find main class-->
                    <addResources>true</addResources>
                </configuration>
            </plugin>
        </plugins>
    </build>

配置热部署

热部署据说比较吃内存,springboot+thymleaf这种前后端交互困难的一般会配置热部署,前后端vue这种项目一般不会配置热部署

在这里插入图片描述
快捷键: ctrl+shift+alt+/ —> 选中register —> 选中下图的选项
在这里插入图片描述
我在register中没找到上图选项,网上说低版本是上图那样配的,高的idea在setting里面
在这里插入图片描述