Skip to content

Commit ec3041e

Browse files
authored
Update 20. Developer tools.md
1 parent cca6d81 commit ec3041e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

III. Using Spring Boot/20. Developer tools.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ dependencies {
1717
compile("org.springframework.boot:spring-boot-devtools")
1818
}
1919
```
20+
**** 在运行一个完整的,打包过的应用时,开发者工具(devtools)会被自动禁用。如果应用使用`java -jar`或特殊的类加载器启动,都会被认为是一个产品级的应用(production application),从而禁用开发者工具。为了防止devtools传递到项目中的其他模块,设置该依赖级别为optional是个不错的实践。不过Gradle不支持`optional`依赖,所以你可能要了解下[propdeps-plugin](https://github.com/spring-projects/gradle-plugins/tree/master/propdeps-plugin)。如果想确保devtools绝对不会包含在一个产品级构建中,你可以使用`excludeDevtools`构建属性彻底移除该JAR,Maven和Gradle都支持该属性。

0 commit comments

Comments
 (0)