IntelliJ IDEA2022.3 springboot 热部署 含静态文件

本文介绍了如何在IntelliJ IDEA中配置Spring Boot项目实现热部署,重点讲解了pom.xml文件的依赖管理、spring-boot-devtools插件的使用,以及application.properties中重启排除项和额外路径设置。通过这些步骤,开发者可以实时预览HTML改动,提升开发效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

IntelliJ IDEA2022 springboot 热部署 html


#pom.xml

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <!--打开开关-->
                <configuration>
                    <fork>true</fork>
                    <addResources>true</addResources>
                </configuration>
            </plugin>

#application.properties

spring.devtools.restart.enabled=true
spring.devtools.restart.exclude=templates
spring.devtools.restart.additional-paths=src/main/java

#idea设置
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
编辑器切换时自动部署。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值