To mix Java and Groovy together in the same IntelliJ IDEA project, a simple change can be made to the project's .iml file. By default, when the project is created it only looks for source files and test files in the src/main/java directory.
By adding two sourceFolder elements IntellJ will automatically find and compile .groovy files in the Groovy directory.