title: gradle: Cannot set the value of read-only property 'module' for root project of type org.gradle.api.Project
body: <p>Starting to get <a href="https://stackoverflow.com/q/45809873/262852">somewhere</a> with <a href="https://stackoverflow.com/q/26644564/262852">packaging</a> an EAR:</p>
  
  <pre><code>thufir@doge:~/NetBeansProjects/gradleEAR$ 
  thufir@doge:~/NetBeansProjects/gradleEAR$ gradle clean ear
  
  FAILURE: Build failed with an exception.
  
  * Where:
  Build file '/home/thufir/NetBeansProjects/gradleEAR/build.gradle' line: 32
  
  * What went wrong:
  A problem occurred evaluating root project 'gradleEAR'.
  &gt; Cannot set the value of read-only property 'module' for root project 'gradleEAR' of type org.gradle.api.Project.
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  
  BUILD FAILED
  
  Total time: 11.862 secs
  thufir@doge:~/NetBeansProjects/gradleEAR$ 
  </code></pre>
  
  <p>How can I set the value for the <code>module</code> property?</p>
  
  <pre><code>plugins {
      id 'com.gradle.build-scan' version '1.8' 
      id 'java'
      id 'application'
      id 'ear'
  }
  
  mainClassName = 'net.bounceme.doge.json.Main'
  
  buildScan {
      licenseAgreementUrl = 'https://gradle.com/terms-of-service'
      licenseAgree = 'yes'
  }
  
  repositories {
      jcenter()
  }
  
  ear {
      manifest {
          attributes 'foo': 'bar'
      }
  
      deploymentDescriptor {  
                  applicationName = "gradleEAR"
                  initializeInOrder = true
                  displayName = "gradleEAR"
                  description = "Trial App EAR for Gradle documentation"
                  libraryDirectory = "WEB-INF/lib"
                  module = "foo"
  /*
                  webModule("TrialApp.war", "TrialApp")  
  */
      }
  
  }
  
  
  
  
  
  
  jar {
      manifest {
          attributes 'Main-Class': 'net.bounceme.doge.json.Main'
      }
  }
  
  task fatJar(type: Jar) {
      baseName = project.name + '-all'
      from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
      with jar
      manifest {
          attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': '3.4.0'
          attributes 'Main-Class': 'net.bounceme.doge.json.Main'
      }
  }
  
  dependencies {
      compile group: 'javax.json', name: 'javax.json-api', version: '1.1'
      compile group: 'org.glassfish', name: 'javax.json', version: '1.1'
      compileOnly 'javax:javaee-api:7.0'
  }
  </code></pre>
  
  <p>possibly useful:</p>
  
  <p><a href="https://discuss.gradle.org/t/set-project-name-property-in-a-test/4333" rel="nofollow noreferrer">https://discuss.gradle.org/t/set-project-name-property-in-a-test/4333</a></p>
  
  <p><a href="http://mrhaki.blogspot.ca/2009/11/gradle-goodness-changing-project-name.html" rel="nofollow noreferrer">http://mrhaki.blogspot.ca/2009/11/gradle-goodness-changing-project-name.html</a></p>