Skip to content

Commit

Permalink
Upgrade Guice to 5.1.0 (#17578)
Browse files Browse the repository at this point in the history
* Move Guice to 5.1.0 and fix tests
* Fix checkstyle
* Revert overrideCurrentGuiceModules() and related changes
* Fix the tests
* Try using maven:3-openjdk-17-slim
* Try enabling debugging for mvn command
* Use maven:3.9 image
* Address review comment: Fix formatting
* Address review comment: Add brief javadoc for ExceptionMatcher
---------
Co-authored-by: imply-cheddar <86940447+imply-cheddar@users.noreply.github.com>
  • Loading branch information
Akshat-Jain authored Dec 19, 2024
1 parent d9a58a7 commit ca8f24e
Show file tree
Hide file tree
Showing 35 changed files with 208 additions and 227 deletions.
5 changes: 0 additions & 5 deletions benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.druid</groupId>
<artifactId>druid-processing</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion distribution/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ARG JDK_VERSION=17
# This is because it's not able to build the distribution on arm64 due to dependency problem of web-console. See: https://github.com/apache/druid/issues/13012
# Since only java jars are shipped in the final image, it's OK to build the distribution on x64.
# Once the web-console dependency problem is resolved, we can remove the --platform directive.
FROM --platform=linux/amd64 maven:3.8.4-openjdk-17-slim as builder
FROM --platform=linux/amd64 maven:3.9 as builder

# Rebuild from source in this stage
# This can be unset if the tarball was already built outside of Docker
Expand Down
5 changes: 0 additions & 5 deletions extensions-contrib/aliyun-oss-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@
<artifactId>jackson-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions extensions-contrib/cassandra-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@
<artifactId>jackson-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>

<!-- Tests -->
<dependency>
Expand Down
6 changes: 0 additions & 6 deletions extensions-contrib/cloudfiles-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@
</exclusions>
<!--$NO-MVN-MAN-VER$ -->
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
<!--$NO-MVN-MAN-VER$ -->
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions extensions-contrib/grpc-query/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@
<artifactId>jackson-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions extensions-contrib/kubernetes-overlord-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,6 @@
<artifactId>jackson-databind</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions extensions-contrib/materialized-view-selection/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@
<artifactId>jackson-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jdbi</groupId>
<artifactId>jdbi</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions extensions-contrib/moving-average-query/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@
<artifactId>jackson-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions extensions-contrib/sqlserver-metadata-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@
<artifactId>jackson-databind</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions extensions-core/azure-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@
<artifactId>jackson-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions extensions-core/google-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@
<artifactId>jackson-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down
6 changes: 1 addition & 5 deletions extensions-core/hdfs-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,7 @@
<artifactId>jackson-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions extensions-core/kubernetes-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@
<artifactId>jackson-databind</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions extensions-core/lookups-cached-global/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@
<artifactId>jackson-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jdbi</groupId>
<artifactId>jdbi</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions extensions-core/multi-stage-query/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@
<artifactId>guice</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions extensions-core/mysql-metadata-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@
<artifactId>jackson-databind</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
Expand Down
6 changes: 1 addition & 5 deletions extensions-core/postgresql-metadata-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,7 @@
<artifactId>jackson-databind</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions extensions-core/s3-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@
<artifactId>jackson-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down
6 changes: 1 addition & 5 deletions indexing-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,7 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions integration-tests-ex/cases/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
Expand Down
6 changes: 1 addition & 5 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,7 @@
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Expand Down
6 changes: 1 addition & 5 deletions licenses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -371,19 +371,15 @@ name: Guice
license_category: binary
module: java-core
license_name: Apache License version 2.0
version: 4.2.2
version: 5.1.0
libraries:
- com.google.inject: guice
- com.google.inject.extensions: guice-multibindings
- com.google.inject.extensions: guice-servlet
- com.google.inject.extensions: guice-assistedinject
notices:
- guice: |
Google Guice - Core Library
Copyright 2006-2016 Google, Inc.
- guice-multibindings: |
Google Guice - Extensions - MultiBindings
Copyright 2006-2016 Google, Inc.
- guice-servlet: |
Google Guice - Extensions - Servlet
Copyright 2006-2016 Google, Inc.
Expand Down
7 changes: 1 addition & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<errorprone.version>2.35.1</errorprone.version>
<fastutil.version>8.5.4</fastutil.version>
<guava.version>32.0.1-jre</guava.version>
<guice.version>4.2.2</guice.version>
<guice.version>5.1.0</guice.version>
<hamcrest.version>1.3</hamcrest.version>
<jetty.version>9.4.56.v20240826</jetty.version>
<jersey.version>1.19.4</jersey.version>
Expand Down Expand Up @@ -596,11 +596,6 @@
<artifactId>guice-servlet</artifactId>
<version>${guice.version}</version>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<version>${guice.version}</version>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-assistedinject</artifactId>
Expand Down
6 changes: 1 addition & 5 deletions processing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public ServiceEmitter(
{
this.serviceDimensions = ImmutableMap
.<String, String>builder()
.put("service", Preconditions.checkNotNull(service))
.put("host", Preconditions.checkNotNull(host))
.put("service", Preconditions.checkNotNull(service, "service should be non-null"))
.put("host", Preconditions.checkNotNull(host, "host should be non-null"))
.putAll(otherServiceDimensions)
.build();
this.emitter = emitter;
Expand Down
Loading

0 comments on commit ca8f24e

Please sign in to comment.