title: Configure .jar to expose its dependencies
body: <p>I have 3 modules: <code>annotations</code>, <code>annotation_processor</code> and <code>app</code>.</p>
  
  <p>annotations/build.gradle</p>
  
  <pre><code>apply plugin: 'java-library'
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
  }
  </code></pre>
  
  <p>annotation_processor/build.gradle</p>
  
  <pre><code>apply plugin: 'java-library'
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
  
      api project(":annotations")
  
      api "com.squareup:javapoet:1.11.1"
  }
  
  repositories {
      mavenCentral()
  }
  
  sourceCompatibility = "1.8"
  targetCompatibility = "1.8"
  
  task deleteJar(type: Delete) {
      delete 'libs/annotations.jar'
  }
  
  task createJar(type: Copy) {
      from('build/intermediates/bundles/release/')
      into('libs/')
      include('classes.jar')
      rename('classes.jar', 'annotations.jar')
  }
  
  createJar.dependsOn(deleteJar, build)
  </code></pre>
  
  <p>and app/build.gradle</p>
  
  <pre><code>dependencies {
      ...
      implementation files('libs/annotation_processor.jar')
      annotationProcessor files('libs/annotation_processor.jar')
      ...
  }
  </code></pre>
  
  <p>When I run the project I get the following error.</p>
  
  <pre><code>error: package com.annotations does not exist
  </code></pre>
  
  <p>If I include <code>annotations</code> as a project the project I can skip this error but then I get.</p>
  
  <pre><code>Caused by: java.lang.NoClassDefFoundError: com/annotations/ProviderApi
  at com.annotation_processor.ProviderAnnotationProcessor.getSupportedAnnotationTypes(ProviderAnnotationProcessor.java:45)
  at org.gradle.api.internal.tasks.compile.processing.DelegatingProcessor.getSupportedAnnotationTypes(DelegatingProcessor.java:47)
  at org.gradle.api.internal.tasks.compile.processing.NonIncrementalProcessor.getSupportedAnnotationTypes(NonIncrementalProcessor.java:33)
  at org.gradle.api.internal.tasks.compile.processing.DelegatingProcessor.getSupportedAnnotationTypes(DelegatingProcessor.java:47)
  at org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor.access$101(TimeTrackingProcessor.java:37)
  at org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor$2.create(TimeTrackingProcessor.java:68)
  at org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor$2.create(TimeTrackingProcessor.java:65)
  at org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor.track(TimeTrackingProcessor.java:117)
  at org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor.getSupportedAnnotationTypes(TimeTrackingProcessor.java:65)
  </code></pre>
  
  <p>I can't access any of the dependencies (Java Poet and <code>annotation</code> module) from <strong>annotation_processor</strong> even though I have replaced <strong>implementation</strong> with <strong>api</strong>. Which should've expose the dependencies, but haven't.</p>
  
  <p>I need the dependencies of the <code>.jar</code> file in the <code>app</code> module.</p>
  
  <p>I'm new to Java Library and it may be I'm making a basic mistake, but can't seem  to figure out, I've been at it for more than a day now.</p>