Community
Participate
Working Groups
Build Identifier: By default, the Eclipse JDT compiler warns about many things, which is rather nice inside an IDE, but is not really usable in a CI or manual console build output. Warnings should be reduced to only print stability relevant information, keeping purely code-related being handled by the IDE or code quality tools. Reproducible: Always
Created attachment 207990 [details] Patch that ignores JDT compiler unnecessary warnings if compiler settings are set not to show warnings.
thanks for the patch, I intend to merge it. You need to answer the following questions: 1. Did you author 100% of the content you are contributing 2. Do you have the rights to donate the content to Eclipse 3. Are you contributing the content under the EPL
note that 3 of the ignored warnings actually can't be ignored in general: settings.put(CompilerOptions.OPTION_ReportAssertIdentifier, compilerOptions.IGNORE); this is an error if compiler source level >= 1.4 settings.put(CompilerOptions.OPTION_ReportEnumIdentifier, CompilerOptions.IGNORE); this is an error if compiler source level >= 1.5 settings.put(CompilerOptions.OPTION_ReportForbiddenReference, CompilerOptions.IGNORE); This is an error by default as it reports access to non-exported OSGi packages and we want to keep it as error. I will remove these 3 lines.
(In reply to comment #3) after some reconsideration, I think we should not use the low-level options map for this. These are implementation details which could change anytime. Rather use the CLI options [1] -warn:none -deprecation / -warn:-deprecation -g / -g:none [1] http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Fguide%2Fjdt_api_compile.htm
looking at the code again, I realized that warnings are already not shown by default: http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java#n192 and http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java#n97 same applies for deprecation and debug options. Feel free to reopen if you can provide a sample project which demonstrates the problem and steps to reproduce.
It might be some code that we used to add to the old plexus-compiler-eclipse implementation, which uses a JDT compiler from a different package (org.eclipse.jdt.core.compiler.batch). I tested the current HEAD of this project and didn't notice unnecessary warning. I guess, as for other functionalities, the implementation used here just doesn't have the same issue. Sorry fir the inconvenience, you can keep this issue closed.