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
Regression: @Inherited annotations declared in superclass are not recognized anymore #24077
Comments
It looks like spring-boot v2.2 uses deprecated way to discover annotations org.springframework.core.type.StandardAnnotationMetadata with nestedAnnotationsAsMap set to true. With nestedAnnotationsAsMap = false everything works as expected. |
@philwebb This seems like a bug in Spring Framework. Could you move it there if you agree? |
@sbrannen Could you look at this one tomorrow? Otherwise I can pick it up on Friday. |
Sure, I'll take a look and report back to you. |
Some preliminary debugging reveals the following. Spring Framework 2.1.8The
Spring Framework 5.2.x (master)The
So, it appears that |
This commit introduces failing assertions that are currently disabled via a boolean reproduceGh24077 flag. Setting that flag to true demonstrates the regression for StandardAnnotationMetadata and inconsistencies for SimpleAnnotationMetadata. See gh-24077
@amrynsky, I tested your app locally with the changes I pushed to If you'd like to test it on your own, you can test against the latest snapshot builds -- for example, by specifying the following in the <spring-framework.version>5.2.2.BUILD-SNAPSHOT</spring-framework.version> You'll also need to configure the snapshot repo for Maven as follows. <repository>
<id>repository.spring.snapshot</id>
<name>Spring Snapshot Repository</name>
<url>https://repo.spring.io/snapshot</url>
</repository> Let us know if you run into any issues. |
Just tested in several scenarios including our project and everything works as expected. |
Great! Thanks for letting us know. |
Overview
After migration to spring boot 2.2 we noticed that behavior of the annotations scan has been changed. In our case we define
@SpringBootApplication
in the base abstract classand then multiple concrete applications extend this class
It works fine in the v 2.1.x, but in 2.2 attempt to run the app causes the error:"
Steps to reproduce
demo.zip
The text was updated successfully, but these errors were encountered: