20.5 Remote applications
Spring Boot开发者工具并不仅限于本地开发,在运行远程应用时你也可以使用一些特性。远程支持是可选的,首先必须确保devtools
被包含在远程的打包后的jar中(included in the repackaged archive 重新打包的归档文件)
<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属性可以启用它,例如:
spring.devtools.remote.secret=mysecret
启用
spring-boot-devtools
在远程应用中会有安全风险,你不应该在生产环境中启用它
远程devtools支持被分为两部分,服务端接受连接,另一个是运行在你IDE中的客户端应用(a client application)如果设置spring.devtools.remote.secret属性,服务端组件会自动启用,客户端组件必须手动启动。