title: Exclude some compile dependencies for runtime in Gradle
body: <p>I am using Gradle to build my Groovy application. As usual I specify the <code>compile</code> dependencies in the <code>build.gradle</code> script, like this:</p>
  
  <pre><code>dependencies {
      // groovy
      compile "org.codehaus.groovy:groovy:$groovyVersion"
      compile "org.codehaus.groovy:groovy-json:$groovyVersion"
      compile "org.codehaus.groovy:groovy-test:$groovyVersion"
  
      // some more external dependencies...
  }
  </code></pre>
  
  <p>Ok, for <code>runtime</code> I don't need all of these dependencies, for example I don't need any testing classes. So what I am looking for now is a way to tell Gradle that it should use the same dependencies for <code>runtime</code> as for <code>compile</code> (which is the default anyway), but excluding some of them.</p>
  
  <p>Is there a short way to achieve that, or do I have to list all dependencies for <code>runtime</code> as well?</p>