In my case there is more going on, as the tests work fine in IntelliJ, but break in Maven. I have beans in java/main with "bean defining annotations" I will try to produce a small example to reproduce my case, and maybe open a separate issue.