在Spring boot应用程序中如何阻止tomcat一次又一次地重新启动 代码已更改。
谢谢 苏尼尔
答案 0 :(得分:1)
此依赖项可能位于您的 POM.xml 中:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
它完全用于您所描述的行为,在开发过程中“无需手动重启服务器”。
它会自动禁用,不会出现在生产版本中。
如果您不喜欢它,只需从 POM.xml 中删除依赖项并加载 maven 更改。
您的 IDE 中可能还有一些设置可以暂时关闭此行为。如果您使用 IntelliJ:
下:File
->settings
->build,execution,deployment
->compiler
自动关闭项目的构建
或:
Ctrl+SHIFT+A->registry
关闭compiler.automake.allow.when.app.running
在 Eclipse 或 Spring 工具套件中:
下:Project
取消选中 Build Automatically
答案 1 :(得分:1)