ben-manes / gradle-versions-plugin

Gradle plugin to discover dependency updates
Apache License 2.0
3.86k stars 199 forks source link

Latest version of org.jetbrains.kotlin dependencies are not being found #824

Closed xenomachina closed 8 months ago

xenomachina commented 8 months ago

With gradle.properties:

kotlin_version = 1.8.22

and build.gradle:

plugins {
    id 'com.github.ben-manes.versions' version '0.50.0'
    id 'java-gradle-plugin'
}

repositories {
    mavenCentral()
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

And Gradle wrapper 8.1.1 or 8.5, running ./gradlew dependencyUpdates incorrectly reports that the org.jetbrains.kotlin dependencies are up to date, despite the fact that there are newer versions of these dependencies:

The following dependencies are using the latest milestone version:
 - org.jetbrains.kotlin:kotlin-compiler-embeddable:1.8.22
 - org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:1.8.22

It looks like this bug was introduced in 0.47.0, as downgrading gradle-versions-plugin to 0.46.0 fixes this problem. With that version, ./gradlew dependencyUpdates correctly reports:

The following dependencies have later milestone versions:
 - com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin [0.46.0 -> 0.50.0]
 - org.jetbrains.kotlin:kotlin-stdlib [1.8.22 -> 2.0.0-Beta3]
     https://kotlinlang.org/

In this discussion, @ben-manes indicated that this may be related to #768.

cc: @tresat @jvandort

ben-manes commented 8 months ago

I confirmed that reverting #768 resolves your problem.

  1. Set local jdk to 11 (jenv local 11.0)
  2. git revert 852c610360ae47494e8da41a120aead37bb06a9b
  3. Incremented VERSION_NAME in gradle.properties
  4. Published locally (publishToMavenLocal)
  5. Ran your sample with the local plugin by adding mavenLocal() as a plugin repository
build.gradle ```groovy apply plugin: 'com.github.ben-manes.versions' apply plugin: 'java-gradle-plugin' buildscript { repositories { // Use 'gradle install' to install latest mavenLocal() gradlePluginPortal() } dependencies { classpath 'com.github.ben-manes:gradle-versions-plugin:0.50.1' } } repositories { mavenCentral() } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.22" implementation "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22" } ```
console report ```console ➜ groovy git:(master) ✗ gradle dU executing gradlew instead of gradle > Task :dependencyUpdates ------------------------------------------------------------ : Project Dependency Updates (report to plain text file) ------------------------------------------------------------ The following dependencies are using the latest milestone version: - com.github.ben-manes:gradle-versions-plugin:0.50.1 The following dependencies have later milestone versions: - org.jetbrains.kotlin:kotlin-gradle-plugin [1.8.22 -> 2.0.0-Beta3] https://kotlinlang.org/ - org.jetbrains.kotlin:kotlin-stdlib [1.8.22 -> 2.0.0-Beta3] https://kotlinlang.org/ Gradle release-candidate updates: - Gradle: [8.0.2 -> 8.5 -> 8.6-rc-2] ```
ben-manes commented 8 months ago

Released, thanks @tresat!