title: How to add Project Dependency using gradle?
body: <p>I am facing the following problem. I need to build the multi-project, but when I try to add the dependency I got the following error.</p>
  
  <p><strong>Root Project's settings.gradle:</strong></p>
  
  <pre><code>include 'DbServices','HelloWeb'
  </code></pre>
  
  <p><strong>Root Project's build.gradle:</strong></p>
  
  <pre><code>apply plugin: 'java'
  project(':HelloWeb') {
     dependencies {
        compile (':DbServices')   
     }
  }
  </code></pre>
  
  <p><strong>DbServices's build.gradle:</strong></p>
  
  <pre><code>apply plugin: 'java'
  </code></pre>
  
  <p><strong>HelloWeb's build.gradle:</strong></p>
  
  <pre><code>apply plugin: 'java'
  </code></pre>
  
  <p>However, then I am getting the following error when synchronize with the gradle tasks on Root Project:</p>
  
  <blockquote>
    <p>Executing command: "tasks"</p>
  </blockquote>
  
  <p>FAILURE: Build failed with an exception.</p>
  
  <ul>
  <li><p>Where:
  Build file 'D:\MyDeployment\RootProject\build.gradle' line: 21</p></li>
  <li><p>What went wrong:
  A problem occurred evaluating root project 'RootProject'.</p>
  
  <blockquote>
    <p>Could not find method compile() for arguments [:DbServices] on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@3b3e3b3e.</p>
  </blockquote></li>
  <li><p>Try:
  Run with --info or --debug option to get more log output.</p></li>
  <li><p>Exception is:
  org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'RootProject'.</p></li>
  </ul>