ben-manes / gradle-versions-plugin

Gradle plugin to discover dependency updates
Apache License 2.0
3.88k stars 201 forks source link

Misleading report #688

Open emartynov opened 2 years ago

emartynov commented 2 years ago

Hi people,

I switched to the toml file and I started getting a confusing report.

The toml file has the latest dependency version:

[versions]
# Versions
androidx-activity = "1.5.1"

However, in the output I see that this dependency should be updated. If I open json file I see also next sections:

    "current": {
        "dependencies": [
            {
                "group": "androidx.activity",
                "userReason": null,
                "version": "1.5.1",
                "projectUrl": "https://developer.android.com/jetpack/androidx/releases/activity#1.5.0",
                "name": "activity"
            },

And

   "outdated": {
        "dependencies": [
            {
                "group": "androidx.activity",
                "available": {
                    "release": null,
                    "milestone": "1.5.1",
                    "integration": null
                },
                "userReason": null,
                "version": "1.5.0",
                "projectUrl": "https://developer.android.com/jetpack/androidx/releases/activity#1.5.0",
                "name": "activity"
            },
            {
                "group": "androidx.activity",
                "available": {
                    "release": null,
                    "milestone": "1.5.1",
                    "integration": null
                },
                "userReason": null,
                "version": "1.3.0",
                "projectUrl": "https://developer.android.com/jetpack/androidx/releases/activity#1.3.0",
                "name": "activity-compose"
            },
            {
                "group": "androidx.activity",
                "available": {
                    "release": null,
                    "milestone": "1.5.1",
                    "integration": null
                },
                "userReason": null,
                "version": "1.3.0",
                "projectUrl": "https://developer.android.com/jetpack/androidx/releases/activity#1.3.0",
                "name": "activity-ktx"
            },

Can you give recommendation how to troubleshot it?

emartynov commented 2 years ago

I run scan for the old approach (with dependencies defined in gradle file) and new one (with toml). I see that this dependency is transitive in one of the projects. In both scans it shows it is resolved to the outdated version.

However, the versions plugin for the old situation doesn't give hint about the needed update and with toml it does.

ben-manes commented 2 years ago

Please provide a minimal project that demonstrates the problem. Since we are merely using the Gradle APIs, presumably the two mechanisms are applying different configurations. It is likely that we can't do anything but eluminate on this issue what Gradle is doing under the hood.