title: Trouble with -Xlint:all and maven
body: <p>I'm trying to get maven to output lint level warnings. I've created a small test program that should generate a warning about using a static method from a non-static context, but despite a number of different plugin configuration options, the build always succeeds without any warnings! </p>
  
  <p>After doing some googling, I found suggestions to use the 'compilerArgument(s)' attribute of the compiler plugin, but this doesn't seem to be working for me either.</p>
  
  <p>Here's my sample program that should generate the warning:</p>
  
  <pre><code>package com.dahlgren;
  
      /**
       * Test space
       *
       */
      public class App {
          public static void main( String[] args ) {
              String foo = "foo";
              // I want this to generate a compilation warning
              System.out.println(foo.format("blah"));
          }
      }
  </code></pre>
  
  <p>This program should issue a warning, as the <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#format%28java.lang.String,%20java.lang.Object...%29" rel="noreferrer">javadoc</a> for Java 6 String::format indicates that only static versions of this method exist. I want to catch this case specifically, as it has bitten me in the past and the compiler should detect it :-)</p>
  
  <p>Here is my pom file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;com.dahlgren&lt;/groupId&gt;
    &lt;artifactId&gt;JavaScratchSpace&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;name&gt;JavaScratchSpace&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;  
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;  
                  &lt;version&gt;3.0&lt;/version&gt;
                  &lt;configuration&gt;  
                      &lt;source&gt;1.6&lt;/source&gt;  
                      &lt;target&gt;1.6&lt;/target&gt;  
                      &lt;compilerArgument&gt;-Xlint:all&lt;/compilerArgument&gt;
                      &lt;!--
                      &lt;compilerArguments&gt;
                          &lt;Xlint:all /&gt;
                      &lt;/compilerArguments&gt;
                      --&gt;
                      &lt;showWarnings&gt;true&lt;/showWarnings&gt;
                      &lt;showDeprecation&gt;true&lt;/showDeprecation&gt;
                  &lt;/configuration&gt;  
              &lt;/plugin&gt;  
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;descriptorRefs&gt;
                          &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                      &lt;/descriptorRefs&gt;
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;mainClass&gt;com.dahlgren.App&lt;/mainClass&gt;
                          &lt;/manifest&gt;
                      &lt;/archive&gt;
                  &lt;/configuration&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;single&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I've tried both forms of the compilerArgument(s) attributes to no avail.</p>
  
  <p>Running <code>mvn clean compile</code> yields the following output:</p>
  
  <pre class="lang-none prettyprint-override"><code>[INFO] Scanning for projects...
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building JavaScratchSpace 1.0-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- maven-clean-plugin:2.3:clean (default-clean) @ JavaScratchSpace ---
  [INFO] Deleting file set: /work/fun/JavaScratchSpace/target (included: [**], excluded: [])
  [INFO] 
  [INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ JavaScratchSpace ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory /work/fun/JavaScratchSpace/src/main/resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ JavaScratchSpace ---
  [INFO] Changes detected - recompiling the module!
  [INFO] Compiling 1 source file to /work/fun/JavaScratchSpace/target/classes
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 2.716s
  [INFO] Finished at: Tue Mar 12 11:39:21 PDT 2013
  [INFO] Final Memory: 8M/150M
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>Additional version information:</p>
  
  <pre class="lang-none prettyprint-override"><code>$ mvn --version &amp;&amp; javac -version
  Apache Maven 3.0.4
  Maven home: /usr/share/maven
  Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
  Java home: /usr/lib/jvm/java-6-openjdk-amd64/jre
  Default locale: en_US, platform encoding: UTF-8
  OS name: "linux", version: "3.2.0-29-generic", arch: "amd64", family: "unix"
  javac 1.6.0_24
  </code></pre>