springboot开发,经常提到修改代码无需手动重启的配置。其中有一条就是ctrl+alt+shift+/,选择1 Registry,然后勾选设置compiler.automake.allow.when.app.running。
可 这个选项在2021版本的IDEA里找不到。
2021版本这个选项的配置,改到设置-高级设置模块了。
ctrl+alt+s,进入设置,然后选择高级设置,在Compiler下勾选 Allow auto-make to restart even if developed application is currently running。 大功告成。enjoy。若解决了您的问题,别忘点个赞。
ctrl+alt+s,进入 设置 ==> Build,Execution,Deployment ==> Compiler,勾选 Build project automatically。
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<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>
也就是前文提到的Allow auto-make to restart even if developed application is currently running。
之前版本里,设置是通过 ctrl+alt+/,在弹出的界面选择 1 Registry,进行之后找到对应选项。
2021版本里,是通过crl+alt+s,在Advanced Settings里设置。
若没生效,重启应用,重启IDEA再看看。
评论