Hello everyone
We are using maven shade in latest version 3.3.0 to build our jar. When upgrading from Spring Boot 2.6.8 to 2.7.0 the actuator endpoints seem no longer to work in the shaded jar. Since I am unsure if this is caused by spring boot or maven shade, therefore I raised the issue there too.
I created a small demo project to visualize the issue. All help is appreciated.
Thanks in advance!
Comment From: philwebb
Thanks for the report. This is due to changes we made to the way that auto-configuration classes are found. You can fix your build by changing the <transformers> section to:
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports</resource>
</transformer>
Comment From: philwebb
We should update our spring-boot-starter-parent project and also check our documentation.
Comment From: FloEberle
Thanks a lot, that actually resolves the issue! 😎 How can I buy u a coffee/beer @philwebb ? 🙃
Comment From: mf81bln
@philwebb Thanks a lot for the quick response! ❤️
I assume this is the change you're referring to? https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.7-Release-Notes#changes-to-auto-configuration
If so, perhaps it would be helpful to mention the necessary changes in the release notes? Even though many rely on the spring-boot-starter-parent, I assume that others also encounter the same problem as we did while using spring-boot-dependencies.
Comment From: philwebb
This has now been fixed. I've also added a new section to the release notes.
Comment From: mf81bln
@philwebb Thanks a lot! ❤️