maven
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
Gradle
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-actuator")
testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile("junit:junit")
}
设置 management
设置端口
management:
server:
port: 50015
设置映射路径:默认映射路径为/actuator
management:
endpoints:
web:
base-path: /actua
修改默认端口路径
management:
endpoints:
web:
path-mapping:
health: healthalter