Possible Duplicate:
Java version mismatch in Maven
I have a project which is configured to use Java 1.5 with maven:
mvn help:effective-pom
...
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
...
My machine has Java 1.6 installed, and Maven is using it:
mvn -v
...
Apache Maven 2.2.1 (r801777; 2009-08-06 20:16:01+0100)
Java version: 1.6.0_21
I have imported the project into Eclipse (using mvn eclipse:eclipse
), and it is building it with Java 1.5, as specified in the POM.
Now if I mark an interface implementation method with @Override
, which is disallowed in Java 1.5 but supported in Java 1.6, then Maven will build the project without errors, but Eclipse will mark the annotation as a compile-time error and refuse to build the project.
How can I either get Maven to really compile the project with Java 1.5, or get Eclipse to compile the project using the same settings as Maven?