This message was deleted.
# dependency-management
s
This message was deleted.
t
I think I would declare the plugins as dependencies in
buildSrc/build.gradle
(that can use the same version catalog as the parent build; see here for the syntax for adding plugins as dependencies), or an included build, then apply them without version in the
settings.gradle
. (note: untested, this might not work in practice)
r
Thank you, I will take a look.
v
That will not work. Since many versions
buildSrc
is built after the settings script was evaluated, so you can neither use dependencies declared in
buildSrc
nor code added to
buildSrc
within the settings script.
The version catalogs are designed in a way so that a settings plugin can define the version catalog when it is applied, so the version catalog cannot yet be available when evaluating the settings script. So for settings plugins you indeed have to have the version within the settings script, or parse a TOML file. What you could use instead of
buildSrc
is a settings plugin (can be a no-op plugin) within an included build that is included from within
pluginManagement { ... }
and that then has a dependency on the enterprise plugin.
The build for that included build can of course then use the same version catalog to have the version declared centrally like with Thomas' suggestion.