title: Compile using -source and -target javac options
body: <p>I have upgraded my web application to Java 7 with JAVA_HOME pointing to 1.7. My Maven plugin is reading the Java version from java_home. But I am bit confused after seeing the below setting in pom.xml:</p>
  
  <pre><code>&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;2.3.2&lt;/version&gt;
      &lt;configuration&gt;
          &lt;fork&gt;true&lt;/fork&gt;
          &lt;compilerVersion&gt;1.6&lt;/compilerVersion&gt;
          &lt;source&gt;1.6&lt;/source&gt;
          &lt;target&gt;1.6&lt;/target&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>If I keep the above settings as it is, will Maven compile the Java code with 1.6 or 1.7? As per my understanding based on <a href="http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html" rel="nofollow">this link</a>, the above settings will get preference and the project will be compiled with 1.6 instead of 1.7. Is that correct?</p>
  
  <p>If I give a setting like below and if I have code specific to JDK 1.7, will my code compile now?</p>
  
  <pre><code> &lt;source&gt;1.6&lt;/source&gt;
    &lt;target&gt;1.7&lt;/target&gt;
  </code></pre>
  
  <p>I am not sure; what do the above settings actually mean?</p>