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

Gradle task bootJar broken on CI with Spring 2.3: "Could not resolve com.squareup.okio:okio:2.6.0" #21611

Closed
leobut opened this issue May 28, 2020 · 1 comment
Labels
status: duplicate A duplicate of another issue

Comments

@leobut
Copy link

leobut commented May 28, 2020

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

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 28, 2020
@wilkinsona
Copy link
Member

Thanks for the report. I think this is a duplicate of #21549.

@wilkinsona wilkinsona added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants