This message was deleted.
# community-support
s
This message was deleted.
c
buildscript block is rarely needed. Define the plugins by id in the plugins block.
๐Ÿ‘† 1
where you have subprojects you can define the plugins directly, or create convention plugins to do that (and other cross-cutting configuration).
s
Gotcha thanks. And the next question would be if I have a plugin for a subproject which I want to define with a version stored in properties file, is it idiomatic to define the plugin under the root settings pluginManagement block with apply false and then define it in the subproject. Am I correct?
c
current convention is to define the plugin coordinates/version in version catalog (typically libs.version.toml) and reference that as needed.
๐Ÿ‘† 1
s
But can I reference that within a subproject? From my understanding according the doc I can reference the version only within the pluginManagement
c
you can reference version catalog in subprojects. Not sure where
pluginManagement
keeps coming from - it isnโ€™t referenced in version catalog documentation.
c
thatโ€™s settings/init scripts, a different (older) approach from version catalogs for defining versions. Follow the guidance for version catalogs to setup plugin versions.
๐Ÿ‘ 1
s
Thanks. I will check the new way to set up versions
How can I understand what is the new and old way? Does the documentation informs which way is the newer one?
c
they are both valid ways but serve different purposes. For most projects - use the version catalog. For advanced / special cases pluginManagement can be used.
s
Right. In my case I'm using for spinnaker plug-ins
v
Btw.
apply false
within
pluginManagement { plugins { ... } }
is pointless. That block does anyway not apply anything anywhere. It only defines default versions for plugins if they are applied somewhere else in the build without version. It is the old pre-version-catalogs way to centralize the version declaration for plugins.
๐Ÿ™Œ 1
s
Thanks Vampire for the clarification
๐Ÿ‘Œ 1
am I right that when
libs.versions.toml
is present under
gradle
, is it not needed
Copy code
dependencyResolutionManagement
defined in the
settings.gradle.kts
?
c
partially. the
versionCatalogs
underneath there is typically not used when you have the toml file, though you could use it to have different catalogs, either defined in code or from different toml files.
๐Ÿ™Œ 1
you may still need
dependencyResolutionManagement
for other things, such as defining repositories.
s
thanks Chris
๐Ÿ‘ 1