Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 327
Franz Kafka Avatar asked Jan 10 '12 18:01

Franz Kafka


1 Answers

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.

like image 191
crowne Avatar answered Sep 21 '22 17:09

crowne