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
version 0.7.0 directly (and only partially) upgrades version numbers in libraries #89
Comments
If the core dependency did not update, this is expected. Only the junit-jupiiter dependency changed version, so it would not be correct to bump everything in the group. In stead, the upgraded dependency is updated separately. If core also gets updated to the same version then both dependencies would be added to the group again. |
core is updated as well (since 3 days). And you are saying that if they really update in stages, then at the end I end up with
(i.e. it will replace the hard-coded "4.8.1" in |
I'm saying that if de versions plugin does not see an update for core, this behaviour is correct. When core is updated, the plugin will try to group the versions again for you and reuse any existing group that exists. This is based on the maven group. You can also see this if you update core manually and then run the format task, without checking for updates. |
I restored the original config and rerun the update, and the behavior is unchanged: mockito-core:4.8.1 is available on mavenCentral, but not found. That seems to be an issue in itself. But I really don't like the "break version groups" approach. In many cases, this is chosen because all the libs depend on each other and thus should stay at the same version. I thus would rather keep all the libs consistently on the old version until the whole group can be updated. Would be much nicer to get a warning like "cannot upgrade mockito version from 4.8.0 to 4.8.1 because org.mockito:mockito-core:4.8.1 is not available" in such a case. |
Unfortunately there's really no way to know if a dependency is updated in tandem with other dependencies in the group so I don't think there would be a reliable way to show that error. If you don't get the update, it might be that the dependencies are cached and the versions plugin is not reporting it. You can try running with If you have a project that reproduces this I'm happy to take a look, maybe there's a specific reason why that version is not found or used by the versions plugin in this case. |
After --refresh-dependencies it worked again (upgrading versions to 4.8.1). I will report back here once I find another example. groups: I only re-use version refs in libs for those which are closely related and must advance in sync. Thus, I would never want them to be broken up (I would instead then create 2 different groups with separate versions). But I understand that this is my personal preference. Perhaps we could have an option for this? |
Great! Keep in mind that this usually does not happen unless a project splits off an artifact that doesn't follow a common version or you hit some kind of fluke due to the dependency not being published or visible yet on Maven Central (or in your case most likely cached somewhere). In that sense this is a bit of an edge case and I'm not sure if that justifies adding a setting. In stead of a setting to disable the behaviour or breaking/creating version groups, I'd lean towards printing out a sort of summary when a group is created/changed so that you can better understand why the plugin did what it did. Then, you can always take action yourself like just reverting and bumping the version group, which should also have worked in your case. Would that make sense? |
Sorry to counter proposal your feature request for the second time by the way, this is not intentional, appreciate the feedback ofc! |
I'm facing the same issue here. The task does not update dependencies correctly and does not recognize many new versions, even downgrading some on execution. |
Did you disable those reports in such a way that the json report is being generated? The plugin needs the json report to function, so it might be that it's not generated and therefore no updates are processed. A clean build will yell at you, but you might have a stale report.json around still. |
Seems like I do have a stale report and I have also disabled json by accident, thanks, I think enabling it should solve the issue |
I think we can close this if we add a note about this behavior to the readme |
The dependency plugin configuration is not related to the issue that was initially created. |
I have a
gradle/libs.versions.toml
which contains (among other entries)When running
./gradlew versionCatalogUpdate
, it says:but I end up with
The text was updated successfully, but these errors were encountered: