Maven doesn't use Java 7

Solution 1:

This may not work in maven 2.2.1, but with Maven 3.0.4, simply adding the two properties to the pom's properties enables Java 7 for me:

<properties>
  <maven.compiler.source>1.7</maven.compiler.source>
  <maven.compiler.target>1.7</maven.compiler.target>
</properties>

Solution 2:

perfectly nice explanation on the compatibility issue of jdk 1.7 with maven 2.2.1 given by Mark Peters Maven "could not parse error message" (Java 7 + Maven 2)