title: Maven doesn't use Java 7
body: <p>I want to package a maven-(multi)module, the parent POM includes:</p>
  
  
  
  <pre class="lang-xml prettyprint-override"><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;source&gt;${maven.compiler.source}&lt;/source&gt;
      &lt;target&gt;${maven.compiler.target}&lt;/target&gt;
      &lt;encoding&gt;${project.build.sourceEncoding}&lt;/encoding&gt;
    &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>I'm using Java 1.7 and the properties are specified as follows:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;properties&gt;
    &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;maven.compiler.source&gt;1.7&lt;/maven.compiler.source&gt;
    &lt;maven.compiler.target&gt;1.7&lt;/maven.compiler.target&gt;
    &lt;slf4j.version&gt;1.6.1&lt;/slf4j.version&gt;
  &lt;/properties&gt;
  </code></pre>
  
  <p>The Maven version is 2.2.1:</p>
  
  <pre class="lang-none prettyprint-override"><code>johannes@luna:~/workspace/treetank/bundles/treetank-core$ mvn -version
  Apache Maven 2.2.1 (rdebian-6)
  Java version: 1.7.0
  Java home: /usr/lib/jvm/jdk1.7.0/jre
  Default locale: en_US, platform encoding: UTF-8
  OS name: "linux" version: "3.0.0-14-generic" arch: "amd64" Family: "unix"
  </code></pre>
  
  <p>I have no clue why it doesn't use Java version 1.7. When invoking <code>mvn package</code> I get the error (use -source 7 or higher to enable diamond operator) for instance. Do you know why it tries using 1.6?</p>
  
  <p>The effective POM is:</p>
  
  <pre class="lang-xml prettyprint-override"><code>  &lt;plugin&gt;
      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.3.2&lt;/version&gt;
      &lt;executions&gt;
        &lt;execution&gt;
          &lt;id&gt;default-testCompile&lt;/id&gt;
          &lt;phase&gt;test-compile&lt;/phase&gt;
          &lt;goals&gt;
            &lt;goal&gt;testCompile&lt;/goal&gt;
          &lt;/goals&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.7&lt;/source&gt;
            &lt;target&gt;1.7&lt;/target&gt;
            &lt;encoding&gt;UTF-8&lt;/encoding&gt;
          &lt;/configuration&gt;
        &lt;/execution&gt;
        &lt;execution&gt;
          &lt;id&gt;default-compile&lt;/id&gt;
          &lt;phase&gt;compile&lt;/phase&gt;
          &lt;goals&gt;
            &lt;goal&gt;compile&lt;/goal&gt;
          &lt;/goals&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.7&lt;/source&gt;
            &lt;target&gt;1.7&lt;/target&gt;
            &lt;encoding&gt;UTF-8&lt;/encoding&gt;
          &lt;/configuration&gt;
        &lt;/execution&gt;
      &lt;/executions&gt;
      &lt;configuration&gt;
        &lt;source&gt;1.7&lt;/source&gt;
        &lt;target&gt;1.7&lt;/target&gt;
        &lt;encoding&gt;UTF-8&lt;/encoding&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
  </code></pre>