title: How to add root Project as classpath in Gradle
body: <p>In JAVA eclipse, the main class of the java project is defined as one of the class in the JAR of the 'lib' folder, and the root project (fooBar) is added as a dependency in the classpath. </p>
  
  <p>This can be acheived in eclipse by simply adding the root project in the classpath. However, how do we add the dependency of the root project in gradle?</p>
  
  <pre><code>dependencies {
      compile project(':fooBar');
  }
  
  
  &gt; Project with path ':fooBar' could not be found in root project 'fooBar'.
  </code></pre>
  
  <p>The following is the project structure:</p>
  
  <pre><code>fooBar
  -src/main/java
  -src/test/java
  -JRE System Library
  -gradle
  --wrapper
  --launch.gradle
  -lib
  -build.gradle
  -settings.gradle
  -gradle-apps.settings
  -gradle.properties
  -gradlew
  -gradlew.bat
  </code></pre>