Leon Linhart
05/07/2024, 10:55 AMLeon Linhart
05/07/2024, 10:58 AMDependencyResolutionManagement dependencyResolutionManagement = target.getDependencyResolutionManagement();
MutableVersionCatalogContainer versionCatalogs = dependencyResolutionManagement.getVersionCatalogs();
versionCatalogs.register(VERSION_CATALOG_NAME, versionCatalogBuilder -> {
versionCatalogBuilder.from(VERSION_CATALOG_COORDINATES);
});
From what I can tell, the catalog can only be resolved if I'm also using dependencyResolutionManagement for central repository declaration.Leon Linhart
05/07/2024, 10:59 AMpluginManagement don't apply.)Jendrik Johannes
05/07/2024, 11:03 AMincludeBuild (outside pluginManagement) for the build that creates/exports the catalog.
What is not working is that the catalog is produced by a task, because it is needed at configuration time (and it is not a plugin, but a normal dependency).
So the catalog would need to be defined directly as a TOML file in the project "producing" it. At least I don't know of another solution.
See: https://github.com/gradle/gradle/issues/19288#issuecomment-1399277313Leon Linhart
05/07/2024, 11:29 AMLeon Linhart
05/07/2024, 11:46 AM