title: Which dependencies are added to a Gradle project which uses a 'project lib dependency' and is this configurable?
body: <p>Gradle <a href="https://docs.gradle.org/current/userguide/multi_project_builds.html#sec:project_jar_dependencies" rel="nofollow noreferrer">project lib dependencies</a> are a means of defining a project as requiring, as one of its dependencies, the output from another project.</p>
  <p>The documentation states:</p>
  <blockquote>
  <p>A “lib” dependency is a special form of an execution dependency. It
  causes the other project to be built first and adds the jar with the
  classes of the other project to the classpath. It also adds the
  dependencies of the other project to the classpath.</p>
  </blockquote>
  <p>However, <em>which</em> dependencies of the project are added?  Is it the <code>compile</code>, <code>implementation</code> or <code>runtime</code> dependencies, for instance?  Is this configurable?  i.e. how would I configure a project to require the output of another project and the dependencies from an arbitrary configuration of that other project?</p>
  <p>For instance, in my root project, I can define <code>project1</code> to depend on <code>project2</code>:</p>
  <pre><code>project(&quot;:project1&quot;) {
      dependencies {
          implementation project(':project2')
      }
  }
  </code></pre>
  <p>How do I add the dependencies of an arbitrary configuration of <code>:project2</code> (let's say it's called <code>myConfiguration</code>) to <code>project1</code>?</p>