what are the possibilities that Spring treats /actuator endpoint as static content?
Config:
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.endpoint.health.show-details=always
management.endpoint.metrics.enabled=true
Log:
Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
DEBUG o.s.w.s.m.s.DefaultHandlerExceptionResolver#679 trackingID: Resolved [org.springframework.web.servlet.resource.NoResourceFoundException: No static resource actuator.]
o.s.w.s.DispatcherServlet#1138 trackingID: Completed 404 NOT_FOUND
Comment From: bclozel
Please share a sample application that demonstrates the problem.
Comment From: mindfultechies
please find the sample code here. https://github.com/mindfultechies/sample-service.git. The sample code works fine with Intellij but it does not work with maven build and java -jar command
Comment From: bclozel
I think your POM is probably misconfigured and the resulting jar is missing dependencies. Have you considered inheriting from the spring boot parent POM?
You can see it in action by creating a sample application on https://start.spring.io and adding the relevant parent section to your application.
Please let us know how that goes.
Comment From: mindfultechies
thank you so much Brian. it works as expected after adding parent in pom. But still not clear about the significance of parent tag.
Comment From: bclozel
I'm glad it works for you now. You'll find all the relevant information in the reference docs here.
My advice would be to use the parent POM provided by Spring Boot as it brings all the sensible defaults as well as repackaging configuration. If you need to use a different parent (like a parent POM provided internally by your company) you can learn how to do that in the next section of the same page.