啟用生產就緒功能
spring-boot-actuator
模組提供了 Spring Boot 的所有生產就緒功能。啟用這些功能的建議方式是新增對 spring-boot-starter-actuator
starter 的依賴。
若要將 actuator 新增至基於 Maven 的專案,請新增以下 starter 依賴項
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
對於 Gradle,請使用以下宣告
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
}