title: adding dependencies in subproject causes failure
body: <p>I have a dependencies section in my master build.gradle file</p>
  
  <pre><code>subprojects {
     dependencies {
     }
  }
  </code></pre>
  
  <p>Then I add one to my subproject as only that one is using two local dependencies and that breaks everything with the failure below</p>
  
  <pre><code>dependencies {
      compile fileTree(dir: 'play-1.2.4/framework/lib', include: '*.jar')
      compile fileTree(dir: 'play-1.2.4/framework', include: '*.jar')
  }
  </code></pre>
  
  <blockquote>
    <p>You can't change a configuration which is not in unresolved state!</p>
  </blockquote>
  
  <p>googling this error yields lots of results but I can't seem to decipher from them how to fix this?</p>
  
  <p>NOTE: This did work if I injected the dependencies instead....why is that?</p>
  
  <pre><code>project(':webserver') {
      dependencies {
          compile fileTree(dir: 'play-1.2.4/framework/lib', include: '*.jar')
          compile fileTree(dir: 'play-1.2.4/framework', include: '*.jar')
      }
  }
  </code></pre>
  
  <p><strong>ONE IMPORTANT NOTE: I am not sure if it matters, by my actual master build.gradle is ONE LINE that imports the following one (as I could not get the "master" folder to work out).  could that be the problem?</strong></p>
  
  <p>FULL master build.gradle file</p>
  
  <pre><code>allprojects {
      apply plugin: 'java'
      apply plugin: 'eclipse'
  
      buildDir = 'output'
  
      task hello &lt;&lt; { task -&gt; println "I'm $task.project.name" }
      build &lt;&lt; { task -&gt; println "MASTER: I'm building now classpath=$sourceSets.main.compileClasspath.files" }
  }
  
  subprojects {
  
      version = 'Developer-Build'
      project.ext.genLibDir = file('lib')
      project.ext.fixedLibDir = file('libother')
  
      repositories {
           mavenCentral()
      }
  
      //configurations.compile {
      //  exclude group: 'javax.jms',        module: 'jms'
      //  exclude group: 'com.sun.jdmk',     module: 'jmxtools'
      //  exclude group: 'com.sun.jmx',      module: 'jmxri'
      //}
  
      dependencies {
          compile group: 'org.hibernate',   name: 'hibernate-entitymanager', version: '4.1.4.Final'
          compile group: 'org.slf4j',       name: 'slf4j-api',               version: '1.6.6'
          compile group: 'org.slf4j',       name: 'log4j-over-slf4j',        version: '1.6.6'
          compile group: 'ch.qos.logback',  name: 'logback-core',            version: '1.0.6'
          compile group: 'joda-time',       name: 'joda-time',               version: '2.1'
          compile group: 'com.google.inject',name: 'guice',                  version: '3.0'
          compile group: 'com.google.protobuf',name: 'protobuf-java',        version: '2.4.1'
  
  
          //to be erased soon
          compile group: 'commons-configuration',name:'commons-configuration',version: '1.8'
          compile group: 'org.jboss.netty', name: 'netty',                   version: '3.2.7.Final'
  
          //compile group: 'org.asteriskjava',name: 'asterisk-java',         version: '1.0.0.M3'            
          compile fileTree(dir: project.ext.fixedLibDir, include: '*.jar')
  
      }
  
      task('copyJars') { 
          ext.collection = files { genLibDir.listFiles() }
          delete ext.collection
          copy { from configurations.compile into genLibDir }
          copy { from fixedLibDir into genLibDir }
      }
  
      task('setupAll', dependsOn: ['copyJars','eclipse']) {
          description = 'Update jars from remote repositories and then fix eclipse classpath for master project'
  
      }
  
      hello &lt;&lt; {println "- I depend on stserver"}
  
      build &lt;&lt; { println "subproject:source sets=$sourceSets.main.java.srcDirs" }
  }
  
  task release &lt;&lt; { println "putting together release" }
  
  //TODO: have a release task AND if version is null when running the release task
  //throw an exception telling the user to pass in a version with "./build -Dversion=xxxx"
  //The automated build will call the release task with a version number like that
  gradle.taskGraph.whenReady {taskGraph -&gt;
      if (taskGraph.hasTask(release) &amp;&amp; version == 'Developer-Build') {
          throw new StopExecutionException("You must specify -Dversion=&lt;some version&gt; to run the release task")
      } else {
          version = '1.0-SNAPSHOT'
      }
  }
  </code></pre>
  
  <p>FULL child webserver build.gradle file</p>
  
  <pre><code>sourceSets.main{
    java.srcDirs = ['app']
  }
  
  build &lt;&lt; { println "source sets=$sourceSets.main.java.srcDirs" }
  
  hello &lt;&lt; {println "- Do something specific xxxx"}
  
      dependencies {
          compile fileTree(dir: 'play-1.2.4/framework/lib', include: '*.jar')
          compile fileTree(dir: 'play-1.2.4/framework', include: '*.jar')
      }
  
      eclipse {
      }
  </code></pre>
  
  <p>thanks,
  Dean</p>