Slackbot
06/07/2022, 6:37 PMVampire
06/07/2022, 6:49 PMof generating a catalog from an existing bomA BOM is conceptually very different to a version catalog. A BOM is conceptually equivalent to a platform. It influences resolution, can control transitive dependencies, the dependency on it can be published as part of your metadata, ... A version catalog is as its name states just a catalog of libraries, plugins, and versions your build scripts can pick from which is absolutely transparent to downstream projects or resolution engine.
but as far as i know, i cannot consume & expose catalogs A, B FROM my own catalog C.Why not?
versionCatalogs {
create("C") {
from("A")
from("B")
}
}
it seems like it would be feasible to programmatically generate catalog entries from existing BOMs allowing for the type-safe / autocompletion benefits, without waiting for say, the spring-boot team (š) to provide a native catalogI guess they are just too conceptually different to do that in any good way. For example would you then just have the coordinates without version? Or with version too? Or ...? You could maybe write a plugin that does it for you how you think you need it and makes sense. š Or you can post a feature request to GitHub for the consideration of the Gradle guys if you really think this is something Gradle should support built-in.
grossws
06/07/2022, 7:20 PMBen Madore
06/07/2022, 7:36 PMVampire
06/07/2022, 8:11 PMIIRC you can use from only once in catalog definition
Oh, really? I didn't try it, but the JavaDoc of it made me think it should work.
unless iām missing something it seems like this would be feasible to do for any arbitrary bom.
Quite possible. As I said, you should maybe open a feature request about it.
Chris Lee
06/07/2022, 8:16 PMChris Lee
06/07/2022, 8:17 PMgrossws
06/07/2022, 9:24 PMmelix
06/08/2022, 7:35 AMmelix
06/08/2022, 7:36 AMBen Madore
06/08/2022, 2:07 PMimplementation(<http://libs.org|libs.org>)
is in any appreciable way worse than the traditional string version of implementation(org.springframework.boot:spring-boot-starter-web)"
and could in some cases be preferable (users donāt need to learn new aliases, they just get autocomplete on the gavs they may already be familiar with)
I also agree that micronautās approach is of course preferable, but i hate to say that this seems like another example of gradle refusing to meet users where they are - and valuing the ideal over the pragmatic (see ability to centrally overriding bom properties ala spring dep mgmt plugin). In an ideal world all 3rd parties would follow the approach micronaut took, but we donāt live in that world. IMO itās best to strive to make the end-user experience more āgoodā than to say thereās nothing that can be done until upstreams get their shiz together.
Re: composing, i (surprise!) also think that is the wrong choice from a userās perspective, of course the code-defined workaround is fine for self-managed catalogs, but stinks for combining self & third party into a single consumable (i.e. single enterprise-wide catalog that composes internal & 3rd party ).
Could you possibly link me to the micronaut code that handles the catalog inlining?melix
06/08/2022, 2:09 PMmelix
06/08/2022, 2:11 PMVampire
06/08/2022, 4:20 PMthis seems like another example of gradle refusing to meet users where they areCould well be and some of these occurrences are really unnerving like "optional" support and similar. But if Gradle would just meet the users where they are, we would not have the amazingly great new build tool Gradle is, but a Maven clone that helps noone.
grossws
06/08/2022, 4:26 PMgrossws
06/08/2022, 4:29 PMoptional
is much less painful than absence of provided
in non-war environment. Maybe because I write agree with Gradle team about fallacy of optional
.Chris Lee
06/08/2022, 4:32 PMcompileOnly
?Vampire
06/08/2022, 4:42 PMoptional
was just one example where it needed ages until the Gradle guys came up with a proper solution and refused to do a pragmatic but unclean intermediary solution.
And yeah, what is wrong with compileOnly
?
Just that it is not added to the POM?Ben Madore
06/08/2022, 4:46 PMgrossws
06/08/2022, 4:59 PMcompileOnly/compileOnlyApi
are exactly right, I'm huge fan of these configurations. I don't actually need gradle to define providedCompile/providedRuntime
since I could easily create similar configurations it in a convention plugin.
But sometimes I need some deps to have provided
scope in pom.xml
for maven consumers and it was a bit of pain last time I did it.Ben Madore
06/08/2022, 5:05 PM