Manage plugin versions and related dependencies through custom alias rules
I'm not sure whether to consider this a bug or a feature request (namely, I do not know if the current behavior is there by purpose, if it is an unintended/unspecified behaviour, or if it does not behave as expected)
Describe the bug
Adding custom alias rules may intertwine badly with plugins version management. Consider, e.g.:
plugin.io.gitlab.arturbosch.detekt=1.9.1
version.io.gitlab.arturbosch.detekt..detekt-formatting=1.9.1
Since these two versions must remain aligned, it would be useful to group them into a single versions.properties entry, e.g. by
io.gitlab.arturbosch.detekt:*
^^^^^^
This correctly produces a single version.detekt=1.9.1 entry.
However, from this point on, the plugin can no longer get resolved.
To Reproduce
If necessary, I can produce a minimal project using the two plugins mentioned above. Let me know.
Expected behavior
the plugin and its dependencies are pulled in with the version specified in the versions.properties file
Nice find, this is definitely something to specify in the doc.
Plugins do not support version rules, but, there's already a solution for your use case:
version.io.gitlab.arturbosch.detekt..detekt-formatting=plugin.io.gitlab.arturbosch.detekt
I'm taking the note to improve this area.
Thanks, however running refreshVersions after the substitution of version.io.gitlab.arturbosch.detekt..detekt-formatting=1.9.1 with version.io.gitlab.arturbosch.detekt..detekt-formatting=plugin.io.gitlab.arturbosch.detekt
produces an invalid version.properties file with both:
version.io.gitlab.arturbosch.detekt..detekt-formatting=1.9.1
## # available=1.10.0-RC1
version.io.gitlab.arturbosch.detekt..detekt-formatting=plugin.io.gitlab.arturbosch.detekt
Is it a known behavior? How to solve or work it around?
It might be a poorly handled case now that I think about it. I'll test it later and let you know, note taken.
@DanySK This works:
Version key rule:
io.gitlab.arturbosch.detekt:detekt(-*)
^^^^^^
version.properties file:
plugin.io.gitlab.arturbosch.detekt=version.detekt
version.detekt=1.9.0
## # available=1.9.1
## # available=1.10.0-RC1
Yes this looks like a reasonable workaround! Thanks!