首页 > 解决方案 > 热插拔不适用于 Intellij 和 spring-boot-starter-web 的 Spring Boot

问题描述

我的 spring boot 微服务使用 spring-boot-starter-web,我正在尝试在 intellij 中启用热交换。我尝试添加此依赖项:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <scope>runtime</scope>
</dependency>

然后在 Intellij I 中:

在编译器设置中选中“自动构建项目”并选中 compiler.automake.allow.when.app.running 框并重新启动 Intellij

我运行了我的微服务,然后更改了一个控制器文件,但什么也没发生……有什么想法吗?是 b/c 我使用的是 spring-boot-starter-web 并因此嵌入了 Tomcat 吗?

谢谢!

标签: springtomcatspring-bootspring-boot-starterspring-boot-devtools

解决方案


除了您已经遵循的步骤之外,您是否也介意这样做?这似乎已经在这里得到了回答。

试一试,让我知道它是否也适用于您的情况!

更新值compiler.automake.allow.when.app.running

Ctrl++ShiftA搜索注册表。在注册表中,启用: compiler.automake.allow.when.app.running


推荐阅读