Groovy and IntelliJ - getting code compiled

I had the same problem and had to Add Framework Support and add Groovy to the project to get round this problem.

I created the project using gradle.


Oh, right.

I removed the !?*.groovy entry from the list of, um, entries in the File : Settings -> Compiler -> Resource Patterns thingy.

It doesn't seem to matter if "use external build" is on or off for this, but the !?*.groovy; entry cannot be there.

I wonder if anybody knows why?


I just got your question in my Google results as I had a similar issue. My problem was that I was able to get the groovy code in my IntelliJ 12 project to compile ok, but it wasn't getting wired in properly when I tried to run unit tests within the IDE.

After some investigation, I uncovered that groovy and logback libraries were all set up in the project to be available in the runtime stage of the Maven build of the project, but that resulted in them not being available in the test stage. To fix this, I ended up manually updating the groovy-all and the logback libraries scope from runtime to provided under File->Project Structure->Modules->Dependencies. This allowed me to both compile and test within the IDE while including the Groovy modules as well as the Java modules.

Perhaps you had something similar going on in your project?