Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Use Google Cloud Platform Libraries BOM #2109

Closed
suztomo opened this issue Jan 8, 2020 · 10 comments · Fixed by #2130
Closed

Use Google Cloud Platform Libraries BOM #2109

suztomo opened this issue Jan 8, 2020 · 10 comments · Fixed by #2130

Comments

@suztomo
Copy link
Contributor

suztomo commented Jan 8, 2020

Google Cloud Platform Libraries BOM helps to align the library versions. This will help to prevent unwanted runtime errors such as NoSuchMethodError.

Describe the solution you'd like
Gradle version 5 or newer can use a BOM.

For Maven,

 <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>libraries-bom</artifactId>
        <version>3.3.0</version>
        <type>pom</type>
        <scope>import</scope>
       </dependency>
     </dependencies>
  </dependencyManagement>

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context

List of Maven artifacts covered by the BOM: https://storage.googleapis.com/cloud-opensource-java-dashboard/com.google.cloud/libraries-bom/snapshot/artifact_details.html

@suztomo
Copy link
Contributor Author

suztomo commented Jan 8, 2020

Trying to create a PR.

@suztomo
Copy link
Contributor Author

suztomo commented Jan 8, 2020

Initial attempt failed: https://gist.github.com/suztomo/661e80e1c371a1aa0c3b5ae6f9c06a65 . There seems to be missing element between google-cloud-bom:0.119.0-alpha and libraries-bom:3.3.0. Will troubleshoot further.

CC: @elharo @meltsufin .

@suztomo
Copy link
Contributor Author

suztomo commented Jan 8, 2020

The same error occurs for google-cloud-bom:0.120.2-alpha (latest as of now).

@suztomo
Copy link
Contributor Author

suztomo commented Jan 8, 2020

Locally installing the google-cloud-bom:0.121.0-alpha (not yet released) solved the undefined version problem. Note that google-auth-library-oauth2-http.version had to be updated to 0.19.0 to avoid NoClassDefFoundError.

I'll revisit this issue once libraries-bom incorporates google-cloud-bom:0.121.0-alpha.

@suztomo
Copy link
Contributor Author

suztomo commented Jan 21, 2020

Update. I'll figure out this compilation failure:

[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Spring Cloud GCP 1.3.0.BUILD-SNAPSHOT:
[INFO] 
[INFO] Spring Cloud GCP ................................... SUCCESS [ 17.938 s]
[INFO] Spring Cloud GCP Core Module ....................... SUCCESS [ 10.586 s]
[INFO] Spring Cloud GCP Stackdriver Logging Module ........ SUCCESS [  8.678 s]
[INFO] Spring Cloud GCP Pub/Sub Module .................... SUCCESS [ 14.946 s]
[INFO] Spring Cloud GCP Storage Module .................... SUCCESS [ 20.780 s]
[INFO] Spring Cloud GCP Datastore Module .................. SUCCESS [ 19.960 s]
[INFO] Spring Cloud GCP Cloud Spanner Module .............. SUCCESS [ 19.622 s]
[INFO] Spring Cloud GCP Firestore Module .................. SUCCESS [ 11.921 s]
[INFO] Spring Cloud GCP BigQuery .......................... SUCCESS [  5.006 s]
[INFO] Spring Cloud GCP Vision Module ..................... SUCCESS [ 10.292 s]
[INFO] Spring Cloud GCP IAP Authentication Module ......... SUCCESS [  8.058 s]
[INFO] Spring Cloud GCP Autoconfigure Module .............. FAILURE [ 42.259 s]
[INFO] Spring Cloud GCP Starters .......................... SKIPPED
[INFO] Spring Cloud GCP Support Starter ................... SKIPPED
[INFO] Spring Cloud GCP Pub/Sub Starter ................... SKIPPED
[INFO] Spring Cloud GCP Stream ............................ SKIPPED
[INFO] Spring Cloud GCP Pub/Sub Bus Starter ............... SKIPPED
[INFO] Spring Cloud GCP Config Starter .................... SKIPPED
[INFO] Spring Cloud GCP Datastore Starter ................. SKIPPED
[INFO] Spring Cloud GCP Spanner Starter ................... SKIPPED
[INFO] Spring Cloud GCP Cloud Firestore Starter ........... SKIPPED
[INFO] Spring Cloud GCP Stackdriver Logging Starter ....... SKIPPED
[INFO] Spring Cloud GCP Security IAP Starter .............. SKIPPED
[INFO] Spring Cloud GCP Cloud SQL MySQL Starter ........... SKIPPED
[INFO] Spring Cloud GCP Cloud SQL PostgreSQL Starter ...... SKIPPED
[INFO] Spring Cloud GCP Storage Starter ................... SKIPPED
[INFO] Spring Cloud GCP Cloud Trace Starter ............... SKIPPED
[INFO] Spring Cloud GCP Cloud Vision Starter .............. SKIPPED
[INFO] Spring Cloud GCP Documentation ..................... SKIPPED
[INFO] Spring Cloud GCP Dependencies ...................... SKIPPED
[INFO] Spring Cloud GCP Cloud Foundry ..................... SKIPPED
[INFO] Spring Cloud GCP Cloud Cloud Foundry Starter ....... SKIPPED
[INFO] Spring Cloud GCP Data Firestore Starter ............ SKIPPED
[INFO] Spring Cloud GCP BigQuery Starter .................. SKIPPED
[INFO] Spring Cloud GCP Code Samples ...................... SKIPPED
[INFO] Spring Cloud GCP Runtime Configuration Code Sample . SKIPPED
[INFO] Spring Cloud GCP Trace Code Sample ................. SKIPPED
[INFO] Spring Cloud GCP Logging Code Sample ............... SKIPPED
[INFO] Spring Cloud GCP SQL MySQL Starter Code Sample ..... SKIPPED
[INFO] Spring Cloud GCP Integration Pub/Sub Channel Adapters Code Sample SKIPPED
[INFO] Spring Cloud GCP Integration Pub/Sub Sender Code Sample SKIPPED
[INFO] Spring Cloud GCP Integration Pub/Sub Receiver Code Sample SKIPPED
[INFO] Spring Cloud GCP Integration Pub/Sub Polling Receiver Code Sample SKIPPED
[INFO] Spring Cloud GCP Integration Pub/Sub Integration Test SKIPPED
[INFO] Spring Cloud GCP Storage Sample .................... SKIPPED
[INFO] Spring Cloud GCP Spanner Code Sample ............... SKIPPED
[INFO] Spring Cloud GCP Datastore Code Sample ............. SKIPPED
[INFO] Spring Cloud GCP Datastore Bookshelf Code Sample ... SKIPPED
[INFO] Spring Cloud GCP Pub/Sub Code Sample ............... SKIPPED
[INFO] Spring Cloud GCP with Spring Data JPA Code Sample .. SKIPPED
[INFO] Spring Cloud GCP Vision API Sample ................. SKIPPED
[INFO] Spring Cloud GCP Integration Storage Sample ........ SKIPPED
[INFO] Spring Cloud GCP Stream Pub/Sub Code Sample ........ SKIPPED
[INFO] Spring Cloud GCP Pub/Sub Bus Configuration Management Code Sample SKIPPED
[INFO] Spring Cloud GCP Pub/Sub Bus Sample (Client) ....... SKIPPED
[INFO] Spring Cloud GCP Pub/Sub Bus Sample (Local Configuration) SKIPPED
[INFO] Spring Cloud GCP Pub/Sub Bus Sample (GitHub Configuration) SKIPPED
[INFO] spring-cloud-gcp-pubsub-bus-config-sample-test ..... SKIPPED
[INFO] Spring Cloud GCP Stream Polling Pub/Sub Code Sample  SKIPPED
[INFO] Spring Cloud GCP Pub/Sub Reactive Code Sample ...... SKIPPED
[INFO] Spring Cloud GCP Integration Pub/Sub JSON Payloads Code Sample SKIPPED
[INFO] Spring Cloud GCP Security IAP Sample ............... SKIPPED
[INFO] spring-cloud-gcp-sql-postgres-sample ............... SKIPPED
[INFO] Spring Cloud GCP Vision OCR Demo ................... SKIPPED
[INFO] Spring Cloud GCP Firestore Code Sample ............. SKIPPED
[INFO] Spring Cloud GCP Multi-Spring-Data-Module Code Sample SKIPPED
[INFO] Spring Cloud GCP with Spring Data Firestore Code Sample SKIPPED
[INFO] Spring Cloud GCP with BigQuery Sample .............. SKIPPED
[INFO] Spring Cloud GCP Pub/Sub Stream Binder Functional Code Sample SKIPPED
[INFO] Spring Cloud GCP Pub/Sub Stream Binder Functional Code Sample - Source SKIPPED
[INFO] Spring Cloud GCP Pub/Sub Stream Binder Functional Code Sample - Sink SKIPPED
[INFO] Integration Test for Spring Cloud GCP Pub/Sub Stream Binder Functional Code Sample SKIPPED
[INFO] spring-cloud-gcp-kotlin-samples .................... SKIPPED
[INFO] spring-cloud-gcp-kotlin-app-sample ................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  03:21 min
[INFO] Finished at: 2020-01-21T15:39:28-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project spring-cloud-gcp-autoconfigure: Compilation failure
[ERROR] /Users/suztomo/spring-cloud-gcp/spring-cloud-gcp-autoconfigure/src/main/java/org/springframework/cloud/gcp/autoconfigure/pubsub/GcpPubSubEmulatorAutoConfiguration.java:[49,33] method usePlaintext in class io.grpc.ManagedChannelBuilder<T> cannot be applied to given types;
[ERROR]   required: no arguments
[ERROR]   found: boolean
[ERROR]   reason: actual and formal argument lists differ in length
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :spring-cloud-gcp-autoconfigure
suztomo-macbookpro44:spring-cloud-gcp suztomo$ git diff
diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml
index 9727ac10..b35c331b 100644
--- a/spring-cloud-gcp-dependencies/pom.xml
+++ b/spring-cloud-gcp-dependencies/pom.xml
@@ -203,25 +203,12 @@
                        <!--google-cloud-java BOM-->
                        <dependency>
                                <groupId>com.google.cloud</groupId>
-                               <artifactId>google-cloud-bom</artifactId>
-                               <version>${google-cloud-bom.version}</version>
+                               <artifactId>libraries-bom</artifactId>
+                               <version>3.4.0</version>
                                <type>pom</type>
                                <scope>import</scope>
                        </dependency>
 
-                       <!-- spring-cloud-gcp-starter -->
-                       <dependency>
-                               <groupId>com.google.auth</groupId>
-                               <artifactId>google-auth-library-oauth2-http</artifactId>
-                               <version>${google-auth-library-oauth2-http.version}</version>
-                               <exclusions>
-                                       <exclusion>
-                                               <groupId>com.google.guava</groupId>
-                                               <artifactId>guava</artifactId>
-                                       </exclusion>
-                               </exclusions>
-                       </dependency>
-
                        <dependency>
                                <groupId>io.pivotal.cfenv</groupId>
                                <artifactId>java-cfenv</artifactId>
suztomo-macbookpro44:spring-cloud-gcp suztomo$ 

@elefeint
Copy link
Contributor

elefeint commented Jan 21, 2020

This has changed in gRPC 1.26.

@suztomo
Copy link
Contributor Author

suztomo commented Jan 21, 2020

@elefeint Thank you!

Next step:
Now it becomes hung at [INFO] Running org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.

https://github.com/suztomo/spring-cloud-gcp/tree/libraries-bom

@suztomo
Copy link
Contributor Author

suztomo commented Jan 22, 2020

This start() never returns in org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests...

image

@elefeint Do you happen to know how to debug this problem? https://github.com/suztomo/spring-cloud-gcp/tree/libraries-bom ?

@suztomo
Copy link
Contributor Author

suztomo commented Jan 22, 2020

This seems not specific to the change. Probably problem in my MacBook. Running tests in my Linux.

@suztomo
Copy link
Contributor Author

suztomo commented Jan 22, 2020

The tests pass in my Linux.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants