Search code examples
javaeclipsemavenm2eclipsem2e

Maven m2e enforces its own compiler settings - disable


After starting Eclipse, Mven seems to set the compiler settings to 1.5 and forget all the other global code style settings to ensure a higher code quality.

Is there some way to disable this feature? Or can I specify all compiler and code style checks in my POM?

It is very annoying because Ecplise can't run the app because of not allowed override annotations for interfaces. The tick in Java compiler -> Enable project specific settings is always set after a restart.


Solution

  • You can set the compiler source and target (byte-code) versions in your pom.
    See http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html

    Code style checks can be configured in the pom as part of the maven reports, see http://maven.apache.org/plugins/maven-checkstyle-plugin/
    but I'm not sure whether the integration will pick these up.