标签:src 根据 pom hold 调用 start 访问 div eal
1.多个环境的配置文件
在application.yml 中配置需要调用的配置文件
spring:
profiles:
active: dev
运行方式的,先运行application.yml 再根据active指定的配置文件,进行覆盖。
2.运行状态监控Actuator
pom中引入依赖
<!--运行状态监控--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
在application.yml文件中配置
management: endpoints: web: exposure: include: "*" server: port: 10111 servlet: context-path: / ssl: enabled: false endpoint: health: show-details: always
访问方式:http://localhost:10111/actuator/health
访问结果:
{"status":"UP","details":{"db":{"status":"UP","details":{"database":"MySQL","hello":1}},"diskSpace":{"status":"UP","details":{"total":463330078720,"free":113779286016,"threshold":10485760}}}}
标签:src 根据 pom hold 调用 start 访问 div eal
原文地址:https://www.cnblogs.com/hcfan/p/10118013.html