Slackbot
11/21/2022, 9:41 PMChris Lee
11/22/2022, 3:43 AMA catalog helps with centralizing the dependency versions and is only, as it name implies, a catalog of dependencies you can pick from. We recommend using it to declare the coordinates of your dependencies, in all cases. It will be used by Gradle to generate type-safe accessors, present short-hand notations for external dependencies and it allows sharing those coordinates between different projects easily. Using a catalog will not have any kind of consequence on downstream consumers: it’s transparent to them.
melix
11/22/2022, 7:44 AMmelix
11/22/2022, 7:46 AMversionCatalogs {
create("foo") {
from("...")
version('groovy', '3.0.5') // override the version in the catalog
}
}
melix
11/22/2022, 7:47 AMjava-platform
plugin allows that. What is not very well supported is having properties for versions in the generated POM file.melix
11/22/2022, 7:48 AMPhanindra R
11/22/2022, 7:56 PM"so cannot use the native version overriding feature in Version Catalog anymore"
- the Solution (1) also calls for applying the micronaut platform/bom. So using the catalog version overriding. e.g. version('groovy', '3.0.5')
, may or may not work because the version is also hardcoded in the platform. It will work in some situations and won't in some . While that's predictable, it's not something I'd want non-expert Gradle users to deal with if there's a way.
If there's no platform involved, the overriding will be a breeze for direct dependencies. Let me know if I'm missing something.Phanindra R
11/22/2022, 8:12 PMcatalogs are _not_ designed to "override" dependency resolution
, I agree with that too. The proposed solution (3) will not change the design mechanics of the catalogs. We will only be adding extra convenience methods on the Gradle side to promote better utilization of catalogs for different scenarios. For example,
constraints{ api myCatalog.bundles.someBundle } // I think this already works today. So technically an auto-generated bundle which includes all library entries will pretty much work like a platform without needing one. That is a big deal, to me, because there won't be a split brain anymore on versions between the catalog and the platform.
constraints{ api myCatalog.bundles.someBundle {strictly true}} // adding such convenience might go a long way ..
Just my 2c based on playing with catalogs in the past few months to roll them out across the board at my place.Chris Lee
11/22/2022, 8:21 PM