Closed mindfultechies closed 2 months ago
Please share a sample application that demonstrates the problem.
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
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.
thank you so much Brian. it works as expected after adding parent in pom. But still not clear about the significance of parent tag.
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.
what are the possibilities that Spring treats /actuator endpoint as static content?
Config:
Log: