title: Adding Gradle depdencies to IntelliJ compiler classpath
body: <p>Given a <code>build.gradle</code> that has dependencies like these:</p>
  
  <pre><code>dependencies {
      compile fileTree(dir: 'myLegacyLibsNotYetConverted/lib', include: '*.jar')
      compile fileTree(dir: 'myOtherLegacyLibsNotYetConverted/lib', include: '*.jar')
      compile 'org.springframework:spring-tx:3.1.2.RELEASE'
      compile 'org.springframework:spring-jms:3.1.2.RELEASE'
      compile 'org.springframework:spring-jdbc:3.1.2.RELEASE'
      (...)
  
      testCompile "junit:junit:4.11"
      testCompile fileTree(dir: "legacyBuild/test-lib", include: "*.jar")
      (...)
  
      providedCompile "javax.servlet:servlet-api:2.5"
      providedCompile "javax.servlet.jsp:jsp-api:2.2"
  }
  </code></pre>
  
  <p>What is the easiest/recommended way to add them to the IntelliJ's IDE's classpath so that all my interactive compiler and tests have all the class dependencies they need? Is it possible to sync it every time it changes? </p>
  
  <p>A flexible solution that could work in Eclipse with minor changes would be much appreciated too.</p>