I just tried to install v2.2.3 by updating the Gradle plugin:

plugins {
        id "org.springframework.boot" version "2.2.3.RELEASE" // was 2.2.2.RELEASE
}

However, when I try to build, I get the following dependency resolution error:

> Could not resolve all files for configuration ':example:detachedConfiguration17'.
   > Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.3.
     Required by:
         project :example
      > Cannot choose between the following variants of org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.3:
          - enforcedRuntimeElements
          - runtimeElements
        All of them match the consumer attributes:
          - Variant 'enforcedRuntimeElements' capability org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.3:
              - Unmatched attributes:
                  - Found org.gradle.category 'enforced-platform' but wasn't required.
                  - Found org.gradle.status 'release' but wasn't required.
                  - Found org.gradle.usage 'java-runtime' but wasn't required.
          - Variant 'runtimeElements' capability org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.3:
              - Unmatched attributes:
                  - Found org.gradle.category 'platform' but wasn't required.
                  - Found org.gradle.status 'release' but wasn't required.
                  - Found org.gradle.usage 'java-runtime' but wasn't required.

This is with a pure-Java project (not using Kotlin).

Comment From: denisw

I fixed the problem by upgrading from Gradle v5.6.4 to v6.0.1. I guess either the problem should be worked around or the minimum required Gradle version should be bumped to Gradle v6.

Comment From: xuyu

+1 with Gradle v5.6.4

Comment From: wilkinsona

Thanks for letting us know and sorry for the inconvenience.

The problem’s caused by spring-boot-dependencies upgrading from Kotlin Coroutines 1.3.2 to 1.3.3. Unfortunately this affects pure-Java projects as the Kotlin Coroutines bom is imported in the spring-boot-dependencies bom.

Kotlin Coroutines started publishing Gradle Module Metadata in 1.3.3. They’re building with Gradle 5.6.x and, unfortunately, the metadata it produced breaks resolution of the pom by the dependency management plugin. This is due to a bug in the metadata. Gradle 6 works around this bug on the consuming side by ignored metadata published with Gradle 5. It also corrects the metadata on the producing side. As you have seen, this means that the problem can be avoided by upgrading your build to Gradle 6. It could also be fixed by the Kotlin team doing the same and publishing a new release with updated metadata.

You should be able to work around the problem by overriding the version of the Kotlin Coroutines bom that is imported by Boot’s dependency management:

ext['kotlin-coroutines.version']='1.3.2'

This should allow you to use Gradle 4.x or 5.x.

I’m not yet sure what the way forward should be for Boot 2.2.x. We do not want to require Gradle 6 until Boot 2.4. We also do not want to get stuck on Kotlin Coroutines 1.3.2 in the long term. We may be able to work around the problem in the dependency management plugin or we may be able to get the Kotlin team to make a change to either stop publishing the metadata until they upgrade to Gradle 6. In the meantime, please try the workaround above and let us know if the problem persists.

Comment From: wilkinsona

The recently released 1.0.9 of the Dependency Management Plugin contains a workaround and Spring Boot has been upgraded to use that version in https://github.com/spring-projects/spring-boot/commit/7693d332fa62af9b355ec1ae816ebe43de299783.

Comment From: amarkevich

there is no issue using BOM dependency resolution:

dependencies {
implementation platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")

Comment From: wilkinsona

@amarkevich That’s using Gradle’s platform support rather than the dependency management plugin. Only the latter is affected by the pom resolution problem in Gradle 5.3-5.6 when the pom is accompanied by Gradle Module Metadata.

Comment From: krishnageddam

This problem still exists in my project . I upgrade the Gradle to latest version(6.1) and my Kotlin version is 1.3.6 SpringBoot version is 2.1.6

Error Execution failed for task ':compileJava'.

Could not resolve all files for configuration ':detachedConfiguration66'. Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.3. Required by: project : > Cannot choose between the following variants of org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.3: - enforcedRuntimeElements - runtimeElements All of them match the consumer attributes: - Variant 'enforcedRuntimeElements' capability org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.3: - Unmatched attributes: - Found org.gradle.category 'enforced-platform' but wasn't required. - Found org.gradle.status 'release' but wasn't required. - Found org.gradle.usage 'java-runtime' but wasn't required. - Variant 'runtimeElements' capability org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.3: - Unmatched attributes: - Found org.gradle.category 'platform' but wasn't required. - Found org.gradle.status 'release' but wasn't required. - Found org.gradle.usage 'java-runtime' but wasn't required.

Comment From: snicoll

@krishnageddam Spring Boot 2.1 does not have dependency management for coroutines. As indicated above, if you chose to use coroutines with that version of Spring Boot, upgrade to version 1.0.9 of the Dependency Management Plugin. Alternatively, upgrading to Spring Boot 2.2.4 will work out of the box.

Comment From: krishnageddam

Thank you a lot .

Comment From: jndietz

Experiencing this in my projects as well.

Gradle: 5.6.4 Spring Boot: 2.2.4.RELEASE Dependency Management: 1.0.9.RELEASE Cloud Version: Hoxton.SR1

Comment From: snicoll

@jndietz this issue is closed. If you believe you've found an issue with Spring Boot (remove the Spring Cloud bits first), please create a separate issue with a sample we can run ourselves (a zip or a link to a github repo).