title: Replace gradle dependency with local clone
body: <p>I have a java project, managed with gradle, with a remote dependency resolved through a repository. </p>
  
  <pre><code>implementation 'org.company:very-big-dependency:2.7.1'
  </code></pre>
  
  <p>I want to clone that dependency, work on the local project, and implement a new feature.</p>
  
  <p>Is there a way to make gradle grab the dependency from local as it did from the repository?</p>
  
  <p>I've tried including the project into my <code>settings.gradle</code></p>
  
  <pre><code>include ':app', ":very-big-dependency"
  project(':very-big-dependency').projectDir = new File(settingsDir, '../../very-big-dependency')
  </code></pre>
  
  <p>and defined the dependency on my <code>build.gradle</code></p>
  
  <pre><code>dependencies {
      ...
      implementation project(':very-big-dependency')
  </code></pre>
  
  <p>but when I run <code>build</code> gradle complains that it can't find a subproject of the dependency</p>
  
  <pre><code>A problem occurred evaluating script.
  &gt; Project with path ':sub-project' could not be found in project
  </code></pre>
  
  <p>Being that the project built correctly when it was resolved through the repository, this tells me that gradle is not behaving the same way when building the local project.</p>
  
  <p>The dependency's project builds correctly when calling its own build script on the local clone, tests pass and everything is fine.</p>
  
  <p>Is there anything else I need to tell gradle in my project? Do I need to do anything else with the local dependency? Do I need to build a jar every time I want to test this?</p>
  
  <p><strong>Notes:</strong></p>
  
  <ul>
  <li>No IDE is used to handle this</li>
  <li>Project was created via <code>gradle init</code></li>
  <li>I tried importing <code>:sub-project</code>, just to get:</li>
  </ul>
  
  <pre><code>A problem occurred configuring project ':very-big-dependency'.
  &gt; Could not get unknown property 'compileJava' for project ':sub-project' of type org.gradle.api.Project.
  </code></pre>
  
  <ul>
  <li>I've tried adding a <code>flatDir</code> into <code>repositories</code> but that led nowhere.</li>
  </ul>