title: How can I set the compileOptions for my Gradle Java plugin?
body: <p>I want to set the -parameters command on my gradle build so that I can use reflection to access the name of the parameters. It seems like I should be doing this with the following closure.</p>
  
  <pre><code>compileJava {
      compileOptions {
          compilerArgs &lt;&lt; '-parameters'
      }
  }
  </code></pre>
  
  <p>But compileOptions is listed as read-only, and when I look at the source code there's no setter.</p>
  
  <p><a href="https://gradle.org/docs/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html#org.gradle.api.tasks.compile.JavaCompile:options" rel="noreferrer">https://gradle.org/docs/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html#org.gradle.api.tasks.compile.JavaCompile:options</a></p>
  
  <p>How am I suppose to be able to tell the javac compiler what args to use in Gradle?</p>
  
  <pre><code>Groovy:       2.3.6
  Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
  JVM:          1.8.0_40 (Oracle Corporation 25.40-b25)
  OS:           Windows 7 6.1 amd64
  </code></pre>