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

fix: grpc-alts is used not only in tests #761

Merged
merged 3 commits into from Jan 5, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 15 additions & 7 deletions google-cloud-spanner/pom.xml
Expand Up @@ -142,6 +142,16 @@
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-alts</artifactId>
<scope>runtime</scope>
Copy link
Collaborator

@olavloite olavloite Dec 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grpc-alts is already a compile time dependency as it is a transitive dependency of gax-grpc. This degrades it to a runtime dependency. Is there a reason that we need to downgrade it here, and that we can't just let it be a compile time dependency?

Suggested change
<scope>runtime</scope>

This is the dependency tree completely without the grpc-alts dependency declaration:

[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO]   ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO] 
[INFO] ---------------< com.google.cloud:google-cloud-spanner >----------------
[INFO] Building Google Cloud Spanner 3.1.4-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:3.1.2:tree (default-cli) @ google-cloud-spanner ---
[INFO] com.google.cloud:google-cloud-spanner:jar:3.1.4-SNAPSHOT
[INFO] +- io.grpc:grpc-api:jar:1.34.1:compile
[INFO] |  +- com.google.errorprone:error_prone_annotations:jar:2.4.0:compile
[INFO] |  \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.19:runtime
[INFO] +- io.grpc:grpc-auth:jar:1.34.1:compile
[INFO] +- io.grpc:grpc-context:jar:1.34.1:compile
[INFO] +- io.grpc:grpc-core:jar:1.34.1:compile
[INFO] |  +- com.google.android:annotations:jar:4.1.1.4:runtime
[INFO] |  \- io.perfmark:perfmark-api:jar:0.19.0:runtime
[INFO] +- io.grpc:grpc-netty-shaded:jar:1.34.1:compile
[INFO] +- io.grpc:grpc-protobuf:jar:1.34.1:compile
[INFO] |  \- io.grpc:grpc-protobuf-lite:jar:1.34.1:compile
[INFO] +- io.grpc:grpc-stub:jar:1.34.1:compile
[INFO] +- com.google.api:api-common:jar:1.10.1:compile
[INFO] |  \- com.google.auto.value:auto-value-annotations:jar:1.7.4:compile
[INFO] +- com.google.protobuf:protobuf-java:jar:3.14.0:compile
[INFO] +- com.google.protobuf:protobuf-java-util:jar:3.14.0:compile
[INFO] +- com.google.api.grpc:proto-google-common-protos:jar:2.0.1:compile
[INFO] +- com.google.api.grpc:grpc-google-common-protos:jar:2.0.1:compile
[INFO] |  +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] |  +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] |  +- org.checkerframework:checker-compat-qual:jar:2.5.5:compile
[INFO] |  \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] +- com.google.api.grpc:proto-google-iam-v1:jar:1.0.5:compile
[INFO] +- com.google.cloud:google-cloud-core:jar:1.94.0:compile
[INFO] |  \- com.google.http-client:google-http-client-jackson2:jar:1.38.0:compile
[INFO] |     \- com.fasterxml.jackson.core:jackson-core:jar:2.12.0:compile
[INFO] +- com.google.cloud:google-cloud-core-grpc:jar:1.94.0:compile
[INFO] +- io.opencensus:opencensus-api:jar:0.24.0:compile
[INFO] +- io.opencensus:opencensus-contrib-grpc-util:jar:0.24.0:compile
[INFO] +- com.google.auth:google-auth-library-oauth2-http:jar:0.22.2:compile
[INFO] +- com.google.http-client:google-http-client:jar:1.38.0:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.13:compile
[INFO] |  |  +- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  |  \- commons-codec:commons-codec:jar:1.11:compile
[INFO] |  +- org.apache.httpcomponents:httpcore:jar:4.4.13:compile
[INFO] |  \- io.opencensus:opencensus-contrib-http-util:jar:0.24.0:compile
[INFO] +- com.google.api.grpc:proto-google-cloud-spanner-admin-instance-v1:jar:3.1.4-SNAPSHOT:compile
[INFO] +- com.google.api.grpc:proto-google-cloud-spanner-v1:jar:3.1.4-SNAPSHOT:compile
[INFO] +- com.google.api.grpc:proto-google-cloud-spanner-admin-database-v1:jar:3.1.4-SNAPSHOT:compile
[INFO] +- com.google.api.grpc:grpc-google-cloud-spanner-admin-instance-v1:jar:3.1.4-SNAPSHOT:compile
[INFO] +- com.google.api.grpc:grpc-google-cloud-spanner-v1:jar:3.1.4-SNAPSHOT:compile
[INFO] +- com.google.api.grpc:grpc-google-cloud-spanner-admin-database-v1:jar:3.1.4-SNAPSHOT:compile
[INFO] +- com.google.guava:guava:jar:30.1-android:compile
[INFO] +- com.google.api:gax:jar:1.60.1:compile
[INFO] +- com.google.api:gax-grpc:jar:1.60.1:compile
[INFO] |  \- io.grpc:grpc-alts:jar:1.34.1:compile
[INFO] |     +- io.grpc:grpc-grpclb:jar:1.34.1:compile
[INFO] |     +- org.apache.commons:commons-lang3:jar:3.5:compile
[INFO] |     \- org.conscrypt:conscrypt-openjdk-uber:jar:2.5.1:compile
[INFO] +- org.threeten:threetenbp:jar:1.5.0:compile
[INFO] +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] +- com.google.code.gson:gson:jar:2.8.6:compile
[INFO] +- com.google.auth:google-auth-library-credentials:jar:0.22.2:compile
[INFO] +- junit:junit:jar:4.13.1:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- com.google.api:gax-grpc:jar:testlib:1.60.1:test
[INFO] +- com.google.truth:truth:jar:1.1:test
[INFO] |  +- org.checkerframework:checker-qual:jar:3.7.0:test
[INFO] |  \- org.ow2.asm:asm:jar:9.0:test
[INFO] +- org.mockito:mockito-all:jar:1.10.19:test
[INFO] +- org.json:json:jar:20201115:test
[INFO] +- com.google.guava:guava-testlib:jar:30.1-android:test
[INFO] +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] +- org.openjdk.jmh:jmh-core:jar:1.27:test
[INFO] |  +- net.sf.jopt-simple:jopt-simple:jar:4.6:test
[INFO] |  \- org.apache.commons:commons-math3:jar:3.2:test
[INFO] +- org.openjdk.jmh:jmh-generator-annprocess:jar:1.27:test
[INFO] \- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.470 s
[INFO] Finished at: 2020-12-21T08:17:23+01:00
[INFO] ------------------------------------------------------------------------

</dependency>
<!--
grpc-stub is needed directly by our tests and transitively by grpc-alts at runtime.
So it has to be declared as a direct dependency and to avoid overriding grpc-alts'
runtime requirement it has to be promoted to the runtime scope.
-->
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
Expand Down Expand Up @@ -246,6 +256,11 @@
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-credentials</artifactId>
</dependency>
<!-- Dependency for DirectPath -->
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-alts</artifactId>
</dependency>

<!-- Test dependencies -->
<dependency>
Expand All @@ -254,13 +269,6 @@
<scope>test</scope>
</dependency>

<!-- Test dependency for DirectPath -->
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-alts</artifactId>
<scope>test</scope>
</dependency>

<!-- Need testing utility classes for generated gRPC clients tests -->
<dependency>
<groupId>com.google.api</groupId>
Expand Down