This message was deleted.
# community-support
s
This message was deleted.
v
Don't do
pluginManagement.repositories
. That can work for project plugins but it cannot work for settings plugins. Do
pluginManagement { repositories }
, because the block is extracted and evaluated separately first, so that it can influence settings plugin resolving.
e
in addition to
pluginManagement
, this applies to a few other magical blocks,
buildscript
,
initscript
, and
plugins
. they all potentially impact how the script itself is built, so they need to be in a format that Gradle can extract and evaluate before the rest of the script
l
Wow... I didn't know there was a difference... I thought is was basically the same as using
.apply { }
... Is there some further reading on the differences between the
.
and the block notation?
v
There are some special top-level blocks that get extracted and evaluated separately first. E.g. the
buildscript { ... }
block which has to be extracted as it is used to add stuff to the build script's classpath that are necessary to compile the build script, so it of course needs to be evaluated separately first. Or the
plugins { ... }
block (for Kotlin DSL at least) as it is transplanted to a dummy build that is then evaluated and investigated to determine which type-safe accessors must be generated so that the build script can compile with them and use them. Or the
pluginManagement { ... }
block which is necessary, so that it can influence resolution of settings plugin in the settings script itself like defining plugin repositories or including plugin builds. Specifically for the
pluginManagement
block there is no real documentation about this, but at least all examples and text use the block syntax. In the upgrading section of the user guide it is mentioned that the
pluginManagement
block is now isolated like
buildscript
and
plugins
too.
l
Ok, thanks for the clarifications. I tend to use the
.
notation when I can to reduce indentation when possible but I'll have to be careful
v
Yes you have to. This might also sometimes make things eager that would be lazy instead iirc.