Can m2e configure the warnings of the Eclipse compiler? #742
Replies: 2 comments 3 replies
-
I would be interested in this feature as well. https://github.com/hotpads/datarouter/blob/master/datarouter-parent/pom.xml <compilerArgs>
<!-- https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/tree/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java#n4116 -->
<arg>-err:+enumSwitch</arg>
<arg>-err:+deadCode</arg>
<arg>-err:+noEffectAssign</arg>
<arg>-err:+serial</arg>
<arg>-err:+staticReceiver</arg>
<arg>-err:+suppress</arg>
<arg>-err:+unlikelyCollectionMethodArgumentType</arg>
<arg>-err:+unlikelyEqualsArgumentType</arg>
<arg>-err:+unusedTypeArgs</arg>
</compilerArgs> |
Beta Was this translation helpful? Give feedback.
-
Note that as per https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#compilerArgs is a List, not a name, so the name of the tag doesn't matter. So you called it |
Beta Was this translation helpful? Give feedback.
-
I have a situation with a pure Maven multi-module project, where two of the modules generate Java code from an openapi generator. This works well. (Pure means we do not have any IDE specific files checked into git).
Unfortunately the code generated works, but has a lot of warnings like unused imports, and deprecated methods, which pollutes the Problem panel in Eclipse.
I've managed to make the module compile from the command line with the Eclipse compiler and disabled the warnings with this pom.xml-snippet:
As m2e is capable of setting the compiler level, I was wondering if it also was capable of setting the project specific compiler options from data in the pom.xml. I have not found documentation indicating it can, so this might be a nice enhangement if not.
If so, how should I do it?
Beta Was this translation helpful? Give feedback.
All reactions