The problem only occurs in CI so far (BitBucket pipelines) after upgrading Spring Boot from 2.2.6
to 2.3.0
.
Error
> Task :bootJar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootJar'.
> Could not resolve all files for configuration ':productionRuntimeClasspath'.
> Could not resolve com.squareup.okio:okio:2.6.0.
Required by:
project : > com.squareup.okhttp3:okhttp:4.7.2
> Cannot choose between the following variants of com.squareup.okio:okio:2.6.0:
- jvm-api
- jvm-runtime
- metadata-api
All of them match the consumer attributes:
- Variant 'jvm-api' capability com.squareup.okio:okio:2.6.0:
- Unmatched attributes:
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-api' but the consumer didn't ask for it
- Provides org.jetbrains.kotlin.platform.type 'jvm' but the consumer didn't ask for it
- Variant 'jvm-runtime' capability com.squareup.okio:okio:2.6.0:
- Unmatched attributes:
- Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Provides org.jetbrains.kotlin.platform.type 'jvm' but the consumer didn't ask for it
- Variant 'metadata-api' capability com.squareup.okio:okio:2.6.0:
- Unmatched attributes:
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'kotlin-api' but the consumer didn't ask for it
- Provides org.jetbrains.kotlin.platform.type 'common' but the consumer didn't ask for it
build.gradle file
buildscript {
ext {
kotlinVersion = '1.3.72'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.3.0.RELEASE")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-noarg:$kotlinVersion")
}
}
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: "kotlin-noarg"
apply plugin: "kotlin-jpa"
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = "is.REDACTED.backend"
sourceCompatibility = 11
repositories {
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
}
compileKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation('com.google.cloud.sql:mysql-socket-factory:1.0.16')
implementation('mysql:mysql-connector-java:8.0.20')
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
implementation('org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7')
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.11.0")
implementation('com.squareup.okhttp3:okhttp:4.7.2')
implementation("com.squareup.okhttp3:logging-interceptor:4.7.2")
implementation('com.google.firebase:firebase-admin:6.13.0')
implementation('com.auth0:java-jwt:3.10.3')
implementation('io.springfox:springfox-swagger2:2.9.2')
implementation('io.springfox:springfox-swagger-ui:2.9.2')
}
Used Gradle version: 6.4.1
Comment From: wilkinsona
Thanks for the report. I think this is a duplicate of https://github.com/spring-projects/spring-boot/issues/21549.