Skip to content

Commit fe0305b

Browse files
authored
Update 20.2.3 Disabling restart.md
1 parent 52754e2 commit fe0305b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
###20.2.3 禁用重启
2+
3+
如果不想使用重启特性,你可以通过`spring.devtools.restart.enabled`属性来禁用它,通常情况下可以在`application.properties`文件中设置(依旧会初始化重启类加载器,但它不会监控文件变化)。
4+
5+
如果需要彻底禁用重启支持,比如,不能跟某个特殊库一块工作,你需要在调用`SpringApplication.run(…​)`之前设置一个系统属性,如下:
6+
```java
7+
public static void main(String[] args) {
8+
System.setProperty("spring.devtools.restart.enabled", "false");
9+
SpringApplication.run(MyApp.class, args);
10+
}
11+
```

0 commit comments

Comments
 (0)