springboot热部署与监控
一、热部署
- 添加依赖+Ctrl+F9
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
二、监控
- 添加依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
- yml配置
management.security.enabled=false
自定义健康信息
@Component public class MyAppHealthIndicator implements HealthIndicator { @Override public Health health() { //自定义的检查方法 //Health.up().build()代表健康 return Health.down().withDetail("msg","服务异常").build(); }