title: How to add a dependency from examples on tests in build.gradle
body: <p>I am able to run <code>./gradlew compileTestJava</code>, but <code>./gradlew compileExamplesJava</code> is failing.
  This is my project structure:</p>
  <pre><code>src/examples/org
  └── eclipse
      └── paho
          └── client
              └── mqttv3
                  ├── internal
                  │   ├── security
                  │   ├── websocket
                  │   └── wire
                  ├── logging
                  ├── persist
                  └── util
  src/examples/test/
  src/tests/org/
  └── eclipse
      └── paho
          └── client
              └── mqttv3
                  └── test
                      ├── automaticReconnect
                      ├── client
                      ├── connectionLoss
                      ├── logging
                      ├── properties
                      └── utilities
  </code></pre>
  <p>The file in folder <code>jpf-core/src/examples/test</code> imports some files that are present under <code>jpf-core/src/tests/org</code>. How should I add this dependency in build.gradle? Right now, my build.gradle file looks like this:</p>
  <pre><code>apply plugin: &quot;java&quot;
  
  sourceCompatibility = 1.8
  targetCompatibility = 1.8
  
  repositories {
      mavenCentral()
  }
  
  buildscript {
      repositories {
          maven {
              url &quot;https://plugins.gradle.org/m2/&quot;
          }
      }
      dependencies {
          classpath &quot;gradle.plugin.com.palantir.gradle.gitversion:gradle-git-version:0.11.0&quot;
      }
  }
  
  
  dependencies {
      testImplementation &quot;junit:junit:4.12&quot;
      testCompile &quot;org.ow2.asm:asm:7.1&quot;
      implementation &quot;org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.0&quot;
      examplesImplementation files(&quot;build&quot;)
  }
  
  task copyLibs(type: Copy) {
      from configurations.testCompile
      into 'build'
  }
  </code></pre>
  <p>Gradle does not recognize this line: <code>examplesImplementation files(&quot;build&quot;)</code></p>