-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail Maven build on warnings #2335
Fail Maven build on warnings #2335
Conversation
For the Javadoc plugin it is "warnings" (plural) instead of "warning"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change taught me a couple of slightly upsetting things.
@@ -173,6 +186,7 @@ | |||
<detectOfflineLinks>false</detectOfflineLinks> | |||
<!-- Only show warnings and errors --> | |||
<quiet>true</quiet> | |||
<failOnWarnings>true</failOnWarnings> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this is failOnWarning
for maven-compiler-plugin
and failOnWarnings
for maven-javadoc-plugin
. Yay Maven.
<dependencies> | ||
<!-- Error Prone Annotations is only directly used by gson module, but since this is an optional | ||
dependency and other modules depend on gson module they also need the dependency to avoid | ||
compiler warnings, see comments on https://bugs.openjdk.org/browse/JDK-6331821 --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So apparently this bug from 2005 is still open.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my fault I copied the wrong URL while browsing the bug reports... 🤦
Will create a follow-up pull request to fix that (#2338).
I meant to refer to the same JDK bug report mentioned in #2320 (comment). It looks like both reports might describe the same bug and JDK-6331821 was never closed. But I haven't tested it.
I mainly wanted to refer to that JDK bug report because its fix introduced the compiler warnings.
* Fail Maven build on warnings * Fix configuration parameter name For the Javadoc plugin it is "warnings" (plural) instead of "warning"
* Fail Maven build on warnings * Fix configuration parameter name For the Javadoc plugin it is "warnings" (plural) instead of "warning"
Purpose
Changes the
pom.xml
to fail when compilation and Javadoc warnings are reported, see also #2320 (comment).Description
Also moved the optional Error Prone Annotations dependency to the parent
pom.xml
to avoid compiler warnings for the other modules depending on thegson
module, see #2320 (comment).If you want I can revert the change to also fail on warnings for Javadoc.
Checklist
null
@since $next-version$
(
$next-version$
is a special placeholder which is automatically replaced during release)TestCase
)mvn clean verify javadoc:jar
passes without errors