Spring Boot 2.7.0 with actuator endpoints which is shaded using maven shade plugin leads to 404 on actuator endpoints
Build and run this project using mvn clean package && java -jar target/demo-0.0.1-SNAPSHOT.jar
curl http://localhost:8080/test/ping
returns http 200 pong
-> works
curl http://localhost:8080/actuator/health
return http 200 {"status":"UP"}
-> does not work, returns 404
- Downgrading to Spring 2.6.8
- Building the jar with spring-boot-maven-plugin without shading
- Running the project directly in IntelliJ
See spring-projects/spring-boot#31316, credits to @philwebb
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
<resource>META-INF/spring.schemas</resource>
<resource>META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports</resource>
<resource>META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports</resource>
</transformer>