apache / apache/maven-compiler-plugin

Add new configuration knob <failAfterWarning> that's not "fail fast"

Open
#1,051 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
261
Forks
191
Avg merge
1d 5h
Merged PRs (30d)
8

Description

### New feature, improvement proposal

Setting `true`, 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 `true` or somesuch.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.