GoogleCloudPlatform/spring-cloud-gcp

Spring Cloud GCP 3.6.1 breaks Kotlin 1.6 compatibility

breun opened this issue · 4 comments

breun commented

Describe the bug
Compatibility with Spring Project Versions says that Spring Cloud GCP 3 is compatible with Spring Boot 2.6 and 2.7. These versions of Spring Boot use Kotlin 1.6 by default.

After upgrading a Spring Boot 2.7 / Spring Cloud 2021.0 Kotlin project from Spring Cloud GCP 3.6.0 to 3.6.1 we encounter this error:

[ERROR] /path/to/.m2/repository/com/google/auto/value/auto-value/1.10.2/auto-value-1.10.2.jar!/META-INF/kotlin-stdlib-common.kotlin_module: (-1, -1) Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.

Updating spring-cloud-gcp-dependencies from 3.6.0 to 3.6.1:

  • updated com.google.cloud:libraries-bom from 26.19.0 to 26.20.0, which
  • updated com.google.cloud:google-cloud-bom from 0.200.0 to 0.201.0, which
  • updated com.google.cloud:google-cloud-bigquery from 2.30.1 to 2.31.0, which
  • updated com.google.auto.value:auto-value from 1.10.1 to 1.10.2, which
  • updated org.jetbrains.kotlinx:kotlinx-metadata-jvm from 0.5.0 to 0.6.2, which
  • updated org.jetbrains.kotlin:kotlin-stdlib from 1.7.0 to 1.8.20.

Sample
This sample project reproduces the issue: https://github.com/breun/auto-value-kotlin-issue. Downgrading Spring Cloud GCP from 3.6.1 to 3.6.0 does make it work.

breun commented

I've also reported this issue to auto-value: google/auto#1574

breun commented

auto-value 1.10.3 has been released, with a fix for this issue. I guess this now needs to propagate up the dependency chain via updates of google-cloud-bigquery, google-cloud-bom, libraries-bom and spring-cloud-gcp-dependencies.

breun commented

Until a Spring Cloud GCP update with this fix is available, overriding the auto-value version as a temporary workaround seems to work:

<dependencyManagement>
  <dependencies>
    <dependency>
      <!-- Temporary workaround for Kotlin compatibility issue: https://github.com/GoogleCloudPlatform/spring-cloud-gcp/issues/2122 -->
      <groupId>com.google.auto.value</groupId>
      <artifactId>auto-value</artifactId>
      <version>1.10.3</version>
    </dependency>
    <dependency>
      <!-- Temporary workaround for Kotlin compatibility issue: https://github.com/GoogleCloudPlatform/spring-cloud-gcp/issues/2122 -->
      <groupId>com.google.auto.value</groupId>
      <artifactId>auto-value-annotations</artifactId>
      <version>1.10.3</version>
    </dependency>
  </dependencies>
</dependencyManagement>

@breun Thanks for the update. We'll assume it's fixed in the next version and close it.