MapStruct generated classes and false 'Could not autowire. There is more than one bean of 'xxx' type.' inspection warning
It appears that a recent update of IntelliJ added a new folder for generated classes (/src/main/generated). My project uses MapStruct and in every class where i inject a MapStruct interface/abstract class into a Spring bean's constructor, I'm getting an IntelliJ inspection warning (Could not autowire. There is more than one bean of 'xxx' type.).
Of course the code compiles and runs fine, but I like having my green checkbox displayed for all inspections of a file. Short of disabling this type of inspection, is there something I can change in my project's configuration? Or is this by chance a bug in the editor? I was not having this problem in the past, and I think it started when I noticed the addition of the /src/main/generated folder.
Thanks!
Please sign in to leave a comment.
Thanks for the report, please follow https://youtrack.jetbrains.com/issue/IDEA-231662 for updates.