Make dependency on Error Prone Annotations non-optional (#2346)

This commit is contained in:
Marcono1234 2023-03-19 16:54:31 +01:00 committed by GitHub
parent 1da826dc6c
commit 6eddbf3031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 12 deletions

View File

@ -38,6 +38,17 @@
</properties>
<dependencies>
<!-- This dependency can be considered optional; omitting it during runtime will most likely
not cause any issues. However, it is not declared with `<optional>true</optional>` because
that can lead to cryptic compiler warnings for consumers, and to be on the safe side in case
there are actually issues which could occur when the dependency is missing at runtime.
See also discussion at https://github.com/google/gson/pull/2320#issuecomment-1455233938 -->
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>2.18.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

12
pom.xml
View File

@ -85,18 +85,6 @@
</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 also comments on https://bugs.openjdk.org/browse/JDK-6365854 -->
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>2.18.0</version>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>