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

[1.7.0] Runtime JAR files in the classpath should have the same version #2546

Closed
IgnatBeresnev opened this issue Jun 21, 2022 · 2 comments · Fixed by #2543
Closed

[1.7.0] Runtime JAR files in the classpath should have the same version #2546

IgnatBeresnev opened this issue Jun 21, 2022 · 2 comments · Fixed by #2543
Labels

Comments

@IgnatBeresnev
Copy link
Member

Build fails if Dokka is used as a dependency in buildSrc, initially reported in the community slack: link to message

The same problem is relevant for kotlinx.serialization.

Workarounds

  • Update to Gradle 7.5-rc-2, it will solve the problem
  • Exclude stdlib:
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.7.0") {
    exclude("org.jetbrains.kotlin","kotlin-stdlib-jdk8")
}

Fix

Should hopefully be solved by #2543 in 1.7.10, will post updates here.

Stacktrace

w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /opt/rjaros/.gradle/wrapper/dists/gradle-7.4.2-all/9uukhhbclvbegdvsww0j0cr3p/gradle-7.4.2/lib/kotlin-stdlib-1.5.31.jar (version 1.5)
    /opt/rjaros/.gradle/wrapper/dists/gradle-7.4.2-all/9uukhhbclvbegdvsww0j0cr3p/gradle-7.4.2/lib/kotlin-stdlib-common-1.5.31.jar (version 1.5)
    /opt/rjaros/.gradle/wrapper/dists/gradle-7.4.2-all/9uukhhbclvbegdvsww0j0cr3p/gradle-7.4.2/lib/kotlin-stdlib-jdk7-1.5.31.jar (version 1.5)
    /opt/rjaros/.gradle/wrapper/dists/gradle-7.4.2-all/9uukhhbclvbegdvsww0j0cr3p/gradle-7.4.2/lib/kotlin-stdlib-jdk8-1.5.31.jar (version 1.5)
    /opt/rjaros/.gradle/wrapper/dists/gradle-7.4.2-all/9uukhhbclvbegdvsww0j0cr3p/gradle-7.4.2/lib/kotlin-reflect-1.5.31.jar (version 1.5)
@IgnatBeresnev
Copy link
Member Author

Apparently, this is still happening for Dokka 1.7.10 which is downloaded from gradlePluginPortal(), but it doesn't happen to Dokka 1.7.10 downloaded from mavenCentral(). For some reason, Dokka's .pom file differs for these two repositories, even though it was published not only from the same branch/commit, but from the same build.

Workarounds:

  1. Get Dokka from mavenCentral(). If it's first on the list, it should be given a priority, but you can still exclude from gradlePluginPortal() just in case or if you don't want to change the order.
repositories {
    mavenCentral()
    gradlePluginPortal {
        content {
            // Might not even be needed since mavenCentral() should take precedence
            excludeGroup("org.jetbrains.dokka")
        }
    }
}
  1. Use Gradle 7.5, which can now read Kotlin 1.7 metadata, so the error should be gone.

There's a follow up PR with an attempt to fix it: #2570

@IgnatBeresnev
Copy link
Member Author

We haven't seen this problem for a while, no new reports or anything that would indicate it hasn't been resolved, so I'll close the issue as fixed for now.

Let us know if it still affects you.

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

Successfully merging a pull request may close this issue.

1 participant