title: Gradle sets incorrect (unexpected?) classpath on running task
body: <p>I have my project structured in this way:</p>
  
  <pre><code>projectRoot
    +-src
       +-main
       |   +-java
       |   |   +-package/java files go here
       |   +-resources
       |       +-config
       |           +-files go here
       +-test
           +-java
           |   +-package/java files go here
           +-resources
               +-config
               |   +-files go here
               +-features
                   +-files go here
  </code></pre>
  
  <p>When this project is built, it produces the following output structure:</p>
  
  <pre><code>projectRoot
    +-out
        +-production
        |     +-classes
        |     |   +-package/classes in here
        |     +-resources
        |         +-config
        |             +-files in here
        +-test
              +-classes
              |   +-package/classes in here
              +-resources
                  +-config
                  |   +-files in here
                  +-features
                      +-files in here
  </code></pre>
  
  <p>This is all as expected. I have a task defined to run cucumber tests, which looks like this:</p>
  
  <pre><code>task runCucumber() {
      doLast {
          javaexec {
              main = "cucumber.api.cli.Main"
              args += ['--plugin', 'pretty', '--plugin', 'html:out/reports/cucumber/', '--plugin', 'json:out/reports/cucumber/report.json',
                       '--glue', 'com.example.mypackage.cucumber', 'classpath:features'
                       , '--tags', 'not @ignore']
              systemProperties['http.keepAlive'] = 'false'
              systemProperties['http.maxRedirects'] = '20'
              systemProperties['env'] = System.getProperty("env")
              systemProperties['envType'] = System.getProperty("envType")
              classpath = configurations.cucumber + configurations.compile + configurations.testCompile + sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath
          }
      }
  }
  </code></pre>
  
  <p>When I execute this task, my classes are not found and neither are features.  Clearly, this is due to classpath not being set correctly.  If I run the task with <code>--info</code>, I can see that the classpath is set using the parameter I indicated, however instead of <code>out</code> directories, it contains <code>build</code> directories. I expected the classpath to be:</p>
  
  <pre><code>&lt;all dependencies&gt;:/projectRoot/out/production/classses:/projectRoot/out/production/resources:/projectRoot/out/test/classes:/projectRoot/out/test/resources
  </code></pre>
  
  <p>Yet, the classpath contains the following:</p>
  
  <pre><code>&lt;all dependencies&gt;:/projectRoot/build/classes/java/main:/projectRoot/build/classes/java/test:
  </code></pre>
  
  <p>Interestingly, directory <code>build</code> is not produced at all under the project root. How can I set the classpath so that classes and resources can be found?</p>