title: IntelliJ with gradle and querydsl
body: <p>I am using IntelliJ 14.1.1 (but this issue existed in previous versions) for my gradle project.  I have the following for my gradle file:</p>
  
  <pre><code>apply plugin: 'java'
  apply plugin: 'groovy'
  apply plugin: 'idea'
  apply plugin: 'spring-boot'
  apply plugin: 'jacoco'
  apply plugin: 'maven'
  
  project.ext {
      springBootVersion = '1.1.7.RELEASE'
  }
  
  configurations {
      querydslapt
  }
  
  jacoco {
      toolVersion = "0.7.0.201403182114"
  }
  
  buildscript {
      repositories {
          maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
          maven { url "http://repo.spring.io/libs-milestone" }
          maven { url "http://repo.spring.io/libs-snapshot" }
          mavenLocal()
          mavenCentral()
      }
      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.3.RELEASE")
      }
  }
  
  jar {
     ...
  }
  
  repositories {
      mavenCentral()
      maven { url "http://repo.spring.io/libs-milestone" }
      ...
  }
  
  jacocoTestReport {
      group = "Reporting"
      description = "Generate Jacoco coverage reports after running tests."
  }
  
  task wrapper(type: Wrapper) {
      gradleVersion = '1.11'
  }
  
  //Querydsl
  def generatedSrcDir = 'src/main/generated'
  task createGeneratedSrcDir &lt;&lt; {
      file(generatedSrcDir).mkdirs()
  }
  compileJava.dependsOn createGeneratedSrcDir
  compileJava {
      options.compilerArgs &lt;&lt; '-processor' &lt;&lt; 'com.mysema.query.apt.jpa.JPAAnnotationProcessor' &lt;&lt; '-s' &lt;&lt; file(generatedSrcDir).absolutePath
  }
  clean {
      delete generatedSrcDir
  }  
  </code></pre>
  
  <p>It seems like IntelliJ is losing my settings for the generated sources every time I do a gradle build, and I have to go into Project | Module settings, and manually add the src/main/generated/ to the sources.  </p>
  
  <p>This usually works, but i don't see why I have to keep telling IntelliJ what my source path is.  Is the problem with IntelliJ, or my gradle file?</p>