title: Cannot change dependencies of configuration ':compile' after it has been resolved
body: <p>I have a simple java project that uses json.jar library. gradle.build file content is:</p>
  
  <pre><code>apply plugin: 'java'
  jar {
    manifest {
      attributes(
        'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
        'Main-Class': 'main.java.Main'
      )
    }
  }
  dependencies {
    compile 'org.json:json:20160212'
  }
  </code></pre>
  
  <p>problem is when I want to add json to my classpath and use it, this error happens</p>
  
  <pre><code>* Where:
  Build file '/home/tina-admin/Documents/myJavaProjects/LongMan/build.gradle' line: 11
  
  * What went wrong:
  A problem occurred evaluating root project 'LongMan'.
  &gt; Cannot change dependencies of configuration ':compile' after it has been resolved.
  </code></pre>
  
  <p>how can I solve this?</p>