远程应用(Remote Applications)
Spring Boot devtools 工具,不仅能在本地环境使用,某些特性也可以应用于远程运行中的程序。远程支持是可选择的特性。开启远程支持,你需要确认 devtools 依赖已经包含在应用的打包过程中,如下:1
2
3
4
5
6
7
8
9
10
11<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludeDevtools>false</excludeDevtools>
</configuration>
</plugin>
</plugins>
</build>
然后,你需要设置 spring.devtools.remote.secret
属性,如下:1
spring.devtools.remote.secret=mysecret
在远程应用中开启
spring-boot-devtools
是一个具有安全风险的事情,不应该在生产环境中启用。