title: Maven giving error: try-with-resources is not supported in -source 1.5
body: <p>I am getting errors when trying to create a jar with Maven 3.0.5 using IntelliJ 12.1.4 and Java 7. I am able to run the project via the IDE with no problems, but when I try to package it I get the following errors.  </p>
  
  <p>The relevant section of my POM (taken from <code>Maven By Example</code> by <code>Sonatype</code>) is: </p>
  
  <pre><code>&lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;descriptorRefs&gt;jar-with-dependencies&lt;/descriptorRefs&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>and the errors are: </p>
  
  <pre><code>[ERROR] ...[33,55] error: diamond operator is not supported in -source 1.5
  [ERROR] ...[207,7] error: try-with-resources is not supported in -source 1.5
  [ERROR] ...[73,52] error: diamond operator is not supported in -source 1.5
  [ERROR] ...[129,40] error: multi-catch statement is not supported in -source 1.5
  [ERROR] ...[44,6] error: try-with-resources is not supported in -source 1.5
  [ERROR] ...[28,39] error: diamond operator is not supported in -source 1.5
  [ERROR] ...[31,7] error: try-with-resources is not supported in -source 1.5
  [ERROR] ...[38,6] error: try-with-resources is not supported in -source 1.5
  [ERROR] ...[34,41] error: diamond operator is not supported in -source 1.5
  [ERROR] ...[77,43] error: diamond operator is not supported in -source 1.5
  [ERROR] ...[84,6] error: try-with-resources is not supported in -source 1.5
  [ERROR] ...[281,38] error: diamond operator is not supported in -source 1.5
  [ERROR] ...[13,55] error: diamond operator is not supported in -source 1.5
  [ERROR] ...[155,7] error: try-with-resources is not supported in -source 1.5
  </code></pre>
  
  <p>How can I get maven to use source 1.7?</p>