title: Is it possible to tell -Werror to ignore a certain class or a certain warning during Java compilation?
body: <p>I use Gradle to build my Java project with the following settings to treat warnings as errors:</p>
  
  <pre><code>tasks.withType(JavaCompile) {
    options.compilerArgs &lt;&lt; "-Xlint:unchecked" &lt;&lt; "-Werror"
  }
  </code></pre>
  
  <p>Now we would like to work on some experimental research stuff in a certain class (let's call it <code>Experimental.java</code>) which throws some warnings (<code>warning: XYZ is internal proprietary API and may be removed in a future release</code>). This leads to the problem that the whole project does not build.</p>
  
  <p>Can we exclude a certain class from being checked based on <code>-Werror</code> (i.e., "don't check <code>Experimental.java</code>")? Or can we tell <code>-Werror</code> to ignore a certain warning (i.e., "don't treat <code>internal proprietary API</code> warning as error")? We don't want to turn off <code>-Werror</code> completely, other classes should still be treated that way.</p>