title: Converting .classpath of eclipse to gradle
body: <p>I am trying to convert <code>.classpath</code> to a gradle project(The project is a dynamic web application, using Spring). I am getting the following error.</p>
  
  <pre><code>./gradlew tasks
  Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
  
  FAILURE: Build failed with an exception.
  
  * Where:
  Build file '/home/jsiddharth/workspace/feature_multiple_web_admins/mnoxwebadmin/BuseetaWebAdmin/build.gradle' line: 20
  
  * What went wrong:
  A problem occurred evaluating root project 'BuseetaWebAdmin'.
  &gt; Could not find method compile() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  
  BUILD FAILED
  
  Total time: 12.838 secs
  </code></pre>
  
  <p>My .classpath is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;classpath&gt;
      &lt;classpathentry kind="src" path="src/main/java"&gt;
          &lt;attributes&gt;
              &lt;attribute name="FROM_GRADLE_MODEL" value="true"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="src" path="src/main/resources"&gt;
          &lt;attributes&gt;
              &lt;attribute name="FROM_GRADLE_MODEL" value="true"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="src" path="src/test/java"&gt;
          &lt;attributes&gt;
              &lt;attribute name="FROM_GRADLE_MODEL" value="true"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="src" path="src/test/resources"&gt;
          &lt;attributes&gt;
              &lt;attribute name="FROM_GRADLE_MODEL" value="true"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/&gt;
      &lt;classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/&gt;
      &lt;classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"&gt;
          &lt;attributes&gt;
              &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"&gt;
          &lt;attributes&gt;
              &lt;attribute name="maven.pomderived" value="true"/&gt;
              &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry exported="true" kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/&gt;
      &lt;classpathentry exported="true" kind="var" path="localjar"&gt;
          &lt;attributes&gt;
              &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
  
  
      .. bunch of other local jar's ..
  
  
      &lt;classpathentry exported="true" kind="var" path="mCruiseOnLibs/json-simple-1.1.1.jar"&gt;
          &lt;attributes&gt;
              &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry exported="true" kind="var" path="mCruiseOnLibs/javax.json-1.0.2.jar"&gt;
          &lt;attributes&gt;
              &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry combineaccessrules="false" exported="true" kind="src" path="/localproject"/&gt;
  
      .. bunch of local projects referred ..
  
      &lt;classpathentry kind="output" path="bin"/&gt;
  &lt;/classpath&gt;
  </code></pre>
  
  <p>Gradle build file</p>
  
  <pre><code>buildscript{
  
      //def dropboxfolder = "/home/jsiddharth/Dropbox/mylibs"
  
      repositories {
          jcenter()
          mavenCentral()
      }
  
      dependencies {
          // I copied all local jar's to the libs folder that contains the build.gradle file.
          compile fileTree(dir: 'libs', include: '*.jar')
  
          // compile files('${dropboxfolder}/local.jar'), this did not work, so commented
  
          compile(project(':localproject'))
          testCompile 'junit:junit:4.12'
      }
  }
  
  apply plugin:'java'
  apply plugin : 'war'
  </code></pre>