New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autoimport defined in lib won't be used #35851
Comments
I am not sure what you mean by "autoimport". These are supposed to be auto-configurations, with a well defined lifecycle. Looking at your class, it looks like it's trying to contribute a bean directly which looks a bit odd. That said, if it used to work, we should be able to give you some pointers or fix a bug. Can you please share a small sample that works when the file is added in the app but does not when it is added to the lib. You can share the sample as a zip attached to this issue or by pushing it to a GitHub repo. |
"autoimport" might not be the correct terminology - sorry for the confusion. I was referring to the auto-configuration changed originally with Spring 2.7. With Spring 3.0 the In my use case we want to modify the behavior of the actuator endpoints, which are not configured by the The implementation is currently based on this discussion, since in our context a Filter would not work, since we require the context of the interceptor. |
Yes, I am aware of what the change is but autoimport is still confusing here. As I've asked before, please share a small sample we can run ourselves. |
After some hours of debugging it turned out that apparently a cached snapshot variant (by gradle) somewhere in the dependency tree seems to have been responsible for the problem, although I couldn't track it down anymore. I noticed this when I created a minimal example with Maven and was getting different results. Unfortunately after trying to narrow the dependency problem with the gradle-based service it eventually started also working and I assume during the build changes I forced an update for an unknown dependency. Sorry for the unnecessary overhead for you @snicoll. |
In a current project I have a library defining an autoimport via
org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports
(until recentlyspring.factories
was used). In the main service importing this library the autoimport won't be loaded automatically. If I add the same file to the main service, the loading will work without a problem.Used Spring Boot version: 3.1.0
Potentially related: #32222
Example code for the lib:
Autoimport file at
src/main/resources/META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports
The text was updated successfully, but these errors were encountered: