New feature, improvement proposal
Setting <failOnWarning>true</failOnWarning>, which simply adds the -Werror flag, is documented as "Indicates whether the build will continue even if there are compilation warnings", which is accurate.
However, it would be nice if there were a version of this setting that implemented a slightly different behavior: "Indicates whether the build will fail if there are compilation warnings".
In other words, sometimes you want the build to fail if there are any warnings but you also want the compiler to spit out ALL of those warnings before it stops (i.e., complete the entire compilation process regardless) so you can deal with them all at once, instead of warning-by-warning.
That's not the behavior that -Werror provides; instead it is "fail fast" literally treating warnings like errors. Instead this proposed new option would only work when the plugin is using the javax.tools API (because there is no equivalent javac command line flag) and it would use a DiagnosticListener to track if there were warnings generated, etc.
But this would be a nice feature, perhaps call it <failAfterWarning>true</failAfterWarning> or somesuch.
New feature, improvement proposal
Setting
<failOnWarning>true</failOnWarning>, which simply adds the-Werrorflag, is documented as "Indicates whether the build will continue even if there are compilation warnings", which is accurate.However, it would be nice if there were a version of this setting that implemented a slightly different behavior: "Indicates whether the build will fail if there are compilation warnings".
In other words, sometimes you want the build to fail if there are any warnings but you also want the compiler to spit out ALL of those warnings before it stops (i.e., complete the entire compilation process regardless) so you can deal with them all at once, instead of warning-by-warning.
That's not the behavior that
-Werrorprovides; instead it is "fail fast" literally treating warnings like errors. Instead this proposed new option would only work when the plugin is using thejavax.toolsAPI (because there is no equivalent javac command line flag) and it would use aDiagnosticListenerto track if there were warnings generated, etc.But this would be a nice feature, perhaps call it
<failAfterWarning>true</failAfterWarning>or somesuch.