title: IntelliJ + Groovy + Spock: no Groovy library is defined for module
body: <p>I have been trying to create a Groovy project with Spock testing in IntelliJ IDEA.</p>
  
  <p>Here are steps that I followed:</p>
  
  <ol>
  <li>Created Groovy project and added Maven support.</li>
  <li>Added Spock dependencies and plugin. I am using POM very similar to this one:
  <a href="https://github.com/mariuszs/java-spock-test-sample/blob/master/pom.xml">https://github.com/mariuszs/java-spock-test-sample/blob/master/pom.xml</a></li>
  <li>Due to conflicting Groovy dependency I removed Groovy 2.2 library from the Module Settings->Libraries. This allowed me to run tests.</li>
  <li>I created a Groovy class in "src/main".. but I get the error when I try to run it:</li>
  </ol>
  
  <p><code>Groovyc: Cannot compile Groovy files: no Groovy library is defined for module...</code></p>
  
  <p>I am probably missing something because I am tired of trying different configurations for half of the day.</p>