Maven m2e强制执行自己的编译器设置 - 禁用 [英] Maven m2e enforces its own compiler settings - disable

查看:141
本文介绍了Maven m2e强制执行自己的编译器设置 - 禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

启动Eclipse后,Mven似乎将编译器设置设置为1.5,并忘记所有其他全局代码样式设置,以确保更高的代码质量。



是否有一些禁用此功能的方法?或者我可以在我的POM中指定所有编译器和代码样式检查?



这是非常烦人的,因为Ecplise无法运行应用程序,因为不允许覆盖注释的接口。 Java编译器中的勾选 - > 启用项目特定设置始终在重新启动后设置。

解决方案

您可以在pom中设置编译器源和目标(字节码)版本。

请参阅 http://maven.apache.org/plugins/ maven-compiler-plugin / examples / set-compiler-source-and-target.html



可以在pom中配置代码样式检查,作为maven报告,请参阅 http://maven.apache.org/plugins/maven-checkstyle -plugin /

但我不知道整合是否会选择这些。


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.

解决方案

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.

这篇关于Maven m2e强制执行自己的编译器设置 - 禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆