title: How to use gradle. Java, and Groovy together?
body: <p>I am trying to use a Gradle project in IntelliJ 13 but I keep running into issues such as:</p>
  
  <ul>
  <li>Java files can't see Groovy files</li>
  <li>IntelliJ seems to forget about Groovy and prompts me to configure a GDK for it</li>
  </ul>
  
  <p>I read that the groovy plugin allows Groovy and Java in mixed own source path, but Java wants its own.  So I have the following directory structure:</p>
  
  <ul>
  <li>src\main\groovy</li>
  <li>src\main\java</li>
  <li>src\test\groovy</li>
  </ul>
  
  <p>I have a mix of Java and Groovy classes</p>
  
  <p>Here is my build.gradle:</p>
  
  <pre><code>apply plugin: 'java'
  apply plugin: 'groovy'
  apply plugin: 'eclipse'
  apply plugin: 'idea'
  apply plugin: 'spring-boot'
  apply plugin: 'jacoco'
  apply plugin: 'war'
  
  
  buildscript {
      repositories {
          maven { url "http://repo.spring.io/libs-snapshot" }
          mavenLocal()
      }
      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:1.0.0.RC4")
      }
  }
  
  jar {
      baseName = 'my-app'
      version = '0.1.0'
  }
  
  repositories {
      mavenCentral()
      maven { url "http://repo.spring.io/libs-snapshot" }
  }
  
  dependencies {
      compile("org.springframework.boot:spring-boot-starter-web")
      compile("org.springframework.boot:spring-boot-starter-data-jpa:1.0.0.RC4")
      compile("org.springframework:spring-orm:4.0.0.RC1")
      compile("org.hibernate:hibernate-entitymanager:4.2.1.Final")
      compile("com.h2database:h2:1.3.172")
      compile("joda-time:joda-time:2.3")
      compile("org.thymeleaf:thymeleaf-spring4")
      compile("org.codehaus.groovy.modules.http-builder:http-builder:0.7.1")
      compile ('org.codehaus.groovy:groovy-all:2.2.1')
  
      testCompile('org.spockframework:spock-core:0.7-groovy-2.0') {
          exclude group: 'org.codehaus.groovy', module: 'groovy-all'
      }
      testCompile('org.codehaus.groovy.modules.http-builder:http-builder:0.7+')
      testCompile("junit:junit")
  }
  
  jacocoTestReport {
    &lt;!-- not sure this is right  --&gt;
      group = "Reporting"
      description = "Generate Jacoco coverage reports after running tests."
  }
  
  task wrapper(type: Wrapper) {
      gradleVersion = '1.11'
  }
  </code></pre>
  
  <p>And here is a build error I get when I run "<strong>gradle clean build</strong>":</p>
  
  <pre><code>...src/main/java/com/product/service/FileDownloadService.java:24:  cannot find symbol 
  symbol  : class FileDownload 
  location: class com.product.service.FileDownloadService
  
  private FileDownload fileDownload;
  </code></pre>
  
  <p>If I make everything Java, then I don't get any compile or execution errors.  </p>