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

Plugin section - version.ref is removed and static version is used #119

Open
giorgioprovenzale opened this issue Nov 2, 2023 · 7 comments

Comments

@giorgioprovenzale
Copy link

Sometimes I noticed that in the plugin section of the catalog, the version.ref is removed from a plugin and a static version is used.

Here is an example with kotlin:

[versions]
kotlin = "1.9.10"

[plugins]
jetbrains-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

Then the script suggests this update, instead of updating the kotlin version:

[versions]
kotlin = "1.9.10"

[plugins]
jetbrains-android = "org.jetbrains.kotlin.android:1.9.20"
@hvisser
Copy link
Contributor

hvisser commented Nov 2, 2023

In that case there are probably other usages of that version ref that are not updated. Can you confirm that is the case?

@giorgioprovenzale
Copy link
Author

yes, that's correct. So we should different version values for plugins and libraries, or do you have some other suggestions?

@hvisser
Copy link
Contributor

hvisser commented Nov 2, 2023

Yes or alternatively you could pin the version if you don't want it to update, but generally it means that not all modules update to the same version if this happens, or at least the dependency version plugin is not seeing the updates if they exist. You could try passing --refresh-dependencies to make sure all dependency versions are updated.

@JonatanPlesko
Copy link

Hi @hvisser,
I experience the same issue even if all of the modules have the same version available. I see it with the following dependencies:

Kotlin 1.9.10 to 1.9.20:
org.jetbrains.kotlin:kotlin-stdlib - stays at the previous version despite 1.9.20 being available and removes the reference in the process
org.jetbrains.kotlin.android - correctly keeps the version ref and updates to 1.9.20
org.jetbrains.kotlin.plugin.serialization - correctly keeps the version ref and updates to 1.9.20

Detekt 1.23.0 to 1.23.3:
io.gitlab.arturbosch.detekt:detekt-formatting - keeps the version reference, but stays at 1.23.0 despite 1.23.3 being available
io.gitlab.arturbosch.detekt - removes the version reference and inlines 1.23.3

I can see all of these artifacts sharing the same version when I find them at https://search.maven.org/
I assume the first dependency keeps the ref, and if the next one sharing the same ref finds a different version, it inlines that version. But I don't understand why doesn't the plugin "see" the latest versions as they're available on Maven Central.

@hvisser
Copy link
Contributor

hvisser commented Nov 2, 2023

This seems to be an common issue, but resolving of versions is handled by the dependency versions plugin, not this plugin. If the dependency versions plugin doesn't "see" the version then the report produced might have a few updated versions and a few old versions.

If you experience versions that are not "correct" and you can reproduce these I suggest you file an issue for that plugin. Also make sure you try the refresh flag like I mentioned in the previous comment. It's likely some kind of caching issue. So far I have not been able to reproduce issues like this, probably because they resolve after a while, either when maven central updates or caches expire. At least that is my theory right now.

@hvisser
Copy link
Contributor

hvisser commented Nov 4, 2023

Also I'm curious if you are using any keep settings. When you keep dependencies that you don't use as an actual dependency, the dependency version plugin won't know about it. As a result it won't be included in the report it generates. This might cause the version catalog update plugin to see a partial update too, breaking the version group as only one of multiple dependencies are updated.

@JonatanPlesko
Copy link

I'm not using any keep settings. What you're saying makes sense; I ran the dependency versions plugin independently and I can see that it doesn't detect the latest versions for the aforementioned dependencies. I will try to make a minimal reproducible example and report it there instead.

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

No branches or pull requests

3 participants