Skip to content

Commit

Permalink
Make dependency on Error Prone Annotations non-optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcono1234 committed Mar 18, 2023
1 parent 1da826d commit d07f63c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
11 changes: 11 additions & 0 deletions gson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
12 changes: 0 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit d07f63c

Please sign in to comment.