I had the same problem and setting target dir as an exception did not help. I noticed that the directory:
/target/generated-sources/groovy-stubs/test
installed as Sources Root in IDEA. I would remove this in the user interface and the error will disappear, but as soon as I rebuild the project, it will return to it again. Very frustrating. So far I have not looked at all the goals of the gmavenplus plugin.
It turned out that I had too many goals. If you use only groovy for testing, for example, I (with Spock - I do it with JUnit), you should include only the following goals in this plugin:
addTestSources testGenerateStubs testCompile removeTestStubs
Remove the rest. After you do this IDEA, everything will be fine with your groovy tests (or Specs in my case). Let me know if this really helped.
source share