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

Spring Cloud GCP 3.6.1 breaks Kotlin 1.6 compatibility #2122

Closed
breun opened this issue Aug 14, 2023 · 4 comments
Closed

Spring Cloud GCP 3.6.1 breaks Kotlin 1.6 compatibility #2122

breun opened this issue Aug 14, 2023 · 4 comments

Comments

@breun
Copy link
Contributor

breun commented Aug 14, 2023

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
Copy link
Contributor Author

breun commented Aug 14, 2023

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

@breun
Copy link
Contributor Author

breun commented Aug 15, 2023

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
Copy link
Contributor Author

breun commented Aug 15, 2023

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 breun changed the title Spring Cloud GCP 3.6.1 breaks Kotlin 1.6 / 1.7 compatibility Spring Cloud GCP 3.6.1 breaks Kotlin 1.6 compatibility Aug 16, 2023
@meltsufin
Copy link
Member

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

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

No branches or pull requests

2 participants