Skip to content
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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions gson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@
<version>31.1-jre</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>2.18.0</version>
<optional>true</optional>
</dependency>
</dependencies>

<build>
Expand Down
14 changes: 14 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@
</dependencies>
</dependencyManagement>

<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 -->
Copy link
Member

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. ☹️

Copy link
Collaborator Author

@Marcono1234 Marcono1234 Mar 6, 2023

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.

<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>2.18.0</version>
<optional>true</optional>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -120,6 +132,7 @@
<configuration>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
<failOnWarning>true</failOnWarning>
<fork>true</fork>
<compilerArgs>
<!-- Args related to Error Prone, see: https://errorprone.info/docs/installation#maven -->
Expand Down Expand Up @@ -173,6 +186,7 @@
<detectOfflineLinks>false</detectOfflineLinks>
<!-- Only show warnings and errors -->
<quiet>true</quiet>
<failOnWarnings>true</failOnWarnings>
Copy link
Member

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.

</configuration>
</plugin>
<plugin>
Expand Down