I'm trying to build service to store data in BigQuery.
One of imported dependencies is:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquerystorage</artifactId>
<version>**2.41.0**</version>
</dependency>
which should contains gax dependency in version 2.31.1
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>2.31.1</version>`
Unfortunately when maven builds the project after calling mvn dependency:tree I see the other version of gax and libs. It's my mvn dependency tree:
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.5.5:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:2.5.5:compile
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.5.5:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:2.5.5:compile
[INFO] | | +- ch.qos.logback:logback-classic:jar:1.2.6:compile
[INFO] | | | \- ch.qos.logback:logback-core:jar:1.2.6:compile
[INFO] | | \- org.slf4j:jul-to-slf4j:jar:1.7.32:compile
[INFO] | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] | +- org.springframework:spring-core:jar:5.3.10:compile
[INFO] | | \- org.springframework:spring-jcl:jar:5.3.10:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.28:compile
[INFO] +- org.springframework.kafka:spring-kafka:jar:2.7.7:compile
[INFO] | +- org.springframework:spring-context:jar:5.3.10:compile
[INFO] | | +- org.springframework:spring-aop:jar:5.3.10:compile
[INFO] | | +- org.springframework:spring-beans:jar:5.3.10:compile
[INFO] | | \- org.springframework:spring-expression:jar:5.3.10:compile
[INFO] | +- org.springframework:spring-messaging:jar:5.3.10:compile
[INFO] | +- org.springframework:spring-tx:jar:5.3.10:compile
[INFO] | +- org.springframework.retry:spring-retry:jar:1.3.1:compile
[INFO] | +- org.apache.kafka:kafka-clients:jar:2.7.1:compile
[INFO] | | +- com.github.luben:zstd-jni:jar:1.4.5-6:compile
[INFO] | | +- org.lz4:lz4-java:jar:1.7.1:compile
[INFO] | | \- org.xerial.snappy:snappy-java:jar:1.1.7.7:compile
[INFO] | \- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] +- org.apache.avro:avro:jar:1.9.2:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.12.5:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.12.5:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.12.5:compile
[INFO] | +- org.apache.commons:commons-compress:jar:1.19:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.32:compile
[INFO] +- io.confluent:kafka-avro-serializer:jar:5.3.0:compile
[INFO] | +- io.confluent:kafka-schema-registry-client:jar:5.3.0:compile
[INFO] | +- io.confluent:common-config:jar:5.3.0:compile
[INFO] | \- io.confluent:common-utils:jar:5.3.0:compile
[INFO] | \- com.101tec:zkclient:jar:0.10:compile
[INFO] +- com.google.cloud:google-cloud-bigquerystorage:jar:2.41.0:compile
[INFO] | +- io.grpc:grpc-api:jar:1.56.1:compile
[INFO] | +- io.grpc:grpc-context:jar:1.56.1:compile
[INFO] | +- com.google.errorprone:error_prone_annotations:jar:2.18.0:compile
[INFO] | +- io.grpc:grpc-stub:jar:1.56.1:compile
[INFO] | +- io.grpc:grpc-protobuf:jar:1.56.1:compile
[INFO] | +- io.grpc:grpc-protobuf-lite:jar:1.56.1:compile
[INFO] | +- com.google.api:api-common:jar:1.7.0:compile
[INFO] | +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] | +- com.google.auto.value:auto-value:jar:1.10.2:compile
[INFO] | +- com.google.auto.value:auto-value-annotations:jar:1.10.2:compile
[INFO] | +- com.google.protobuf:protobuf-java:jar:3.23.2:compile
[INFO] | +- com.google.api.grpc:proto-google-common-protos:jar:1.12.0:compile
[INFO] | +- com.google.api.grpc:proto-google-cloud-bigquerystorage-v1beta1:jar:0.42.0:compile
[INFO] | +- com.google.api.grpc:proto-google-cloud-bigquerystorage-v1beta2:jar:0.165.0:compile
[INFO] | +- com.google.api.grpc:proto-google-cloud-bigquerystorage-v1:jar:2.41.0:compile
[INFO] | +- com.google.guava:guava:jar:32.1.1-jre: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-qual:jar:3.33.0:compile
[INFO] | +- com.google.j2objc:j2objc-annotations:jar:2.8:compile
[INFO] | +- com.google.api:gax:jar:1.35.1:compile
[INFO] | +- com.google.auth:google-auth-library-credentials:jar:1.19.0:compile
[INFO] | +- io.opencensus:opencensus-api:jar:0.31.1:compile
[INFO] | +- com.google.auth:google-auth-library-oauth2-http:jar:0.12.0:compile
[INFO] | | \- com.google.http-client:google-http-client-jackson2:jar:1.27.0:compile
[INFO] | +- com.google.api:gax-grpc:jar:1.35.1:compile
[INFO] | +- io.grpc:grpc-alts:jar:1.56.1:compile
[INFO] | +- io.grpc:grpc-grpclb:jar:1.56.1:compile
[INFO] | +- org.conscrypt:conscrypt-openjdk-uber:jar:2.5.2:compile
[INFO] | +- io.grpc:grpc-auth:jar:1.56.1:compile
[INFO] | +- io.grpc:grpc-netty-shaded:jar:1.56.1:compile
[INFO] | +- io.grpc:grpc-googleapis:jar:1.56.1:runtime
[INFO] | +- org.threeten:threetenbp:jar:1.6.8:compile
[INFO] | +- org.json:json:jar:20230618:compile
[INFO] | +- io.grpc:grpc-core:jar:1.56.1:compile
[INFO] | +- com.google.code.gson:gson:jar:2.8.8:compile
[INFO] | +- com.google.android:annotations:jar:4.1.1.4:runtime
[INFO] | +- org.codehaus.mojo:animal-sniffer-annotations:jar:1.23:runtime
[INFO] | +- io.perfmark:perfmark-api:jar:0.26.0:runtime
[INFO] | +- com.google.cloud:google-cloud-core:jar:1.59.0:runtime
[INFO] | | \- joda-time:joda-time:jar:2.9.2:runtime
[INFO] | +- com.google.protobuf:protobuf-java-util:jar:3.23.2:runtime
[INFO] | +- com.google.api.grpc:proto-google-iam-v1:jar:0.12.0:runtime
[INFO] | +- com.google.http-client:google-http-client:jar:1.43.3: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.15:compile
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.14:compile
[INFO] | +- io.opencensus:opencensus-contrib-http-util:jar:0.31.1:compile
[INFO] | +- com.google.http-client:google-http-client-gson:jar:1.43.3:compile
[INFO] | +- com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:jar:0.42.0:compile
[INFO] | +- com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta2:jar:0.165.0:compile
[INFO] | \- com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1:jar:2.41.0:compile
[INFO] +- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] | \- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] +- org.apache.logging.log4j:log4j-api:jar:2.17.0:compile
[INFO] +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.17.0:compile
[INFO] \- org.projectlombok:lombok:jar:1.18.20:compile
and due to this I have some other problems when trying to create BigQueryWriteClient:
BigQueryWriteClient client = BigQueryWriteClient.create();
2023-08-18 11:04:41.704 ERROR [scheduling-1] o.s.s.s.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task java.lang.NoSuchMethodError: 'com.google.api.gax.core.GoogleCredentialsProvider$Builder com.google.api.gax.core.GoogleCredentialsProvider$Builder.setUseJwtAccessWithScope(boolean)
How to fix this problem?