Spring boot actuator "/health" is not working
Do the following steps : -
Change the scope of actuator dependency from
test
tocompile
Instead of using
/health
use/actuator/health
- If you want to see details of the health status then add
management.endpoint.health.show-details=always
in theapplication.properties file
.
In your dependency you have declared
<scope>test</scope>
It means that
test
This scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases.
If you want it available for normal use of the application remove <scope>test</scope>
or change it to <scope>compile</scope>
In Spring Boot 2.0.0 you have to use /actuator/health
and in the application.properties file add the following line:
management.endpoint.health.show-details=always
Add Maven dependency
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
Application.properties
management.endpoints.web.exposure.include= "*"
include all endpoints on actuator
or
management.endpoints.web.exposure.include= health
if need only health endpoint