title: Intellij can not resolve Symbol in Gradle Project with multiple SourceSets
body: <p>I am working on a Gradle Project that uses multiple Sourcesets to build different WARs.</p>
  
  <p>Everything works fine from command line. Gradle builds the WARs correctly. But in IntelliJ it says for every *.java file under src/k that it can not resolve the dependencies from src/main.</p>
  
  <p>I tried to fix it by adding the directories as SourceDirs using the idea-gradle plug in but that did not work, unfortenetly.</p>
  
  <pre><code>plugins {
      id 'org.gretty' version '2.2.0'
      id 'war'
      id 'idea'
  }
  
  configurations {
      kCompile.extendsFrom compile
      kRuntime.extendsFrom runtime
  }
  
  sourceSets {
      main {}        
      k {
          java {
              compileClasspath += main.output
              runtimeClasspath += main.output   
              srcDirs = ['src/main/java', 'src/k/java/']
          }
  
          resources { 
              compileClasspath += main.output
              runtimeClasspath += main.output
              srcDirs = ['src/main/resources', 'src/k/resources']
          }
          output.resourcesDir = 'build/resources/main'
          output.classesDir = 'build/classes/java/main'
      }  
  }
  
  idea {
      module {
          sourceDirs += file('src/main/java')
          sourceDirs += file('src/k/java')
          downloadJavadoc = true
          downloadSources = false
      }    
  }
  
  repositories {
      mavenCentral()
      jcenter()
  }
  
  gretty {
      servletContainer = 'tomcat85'
  }
  
  dependencies {
      ...
  }
  
  task kWar(type: War) {
      appendix = "k"
      from sourceSets.k.output
  }
  
  
  farm {
      webapp "build/libs/App-k.war", contextPath: '/k'
  }
  
  project.afterEvaluate {
      farmRunWar.dependsOn kWar
      farmRunWar.shouldRunAfter kWar
  
  }
  </code></pre>