I thought there are no difference between buildSrc and include-bulid, but there is.
Well, that assumption was wrong. buildSrc is always special.
Since Gradle 8, it was made even more similar to an included build, but there are still slight differences between the two.
Is this intended behaivor in include-build?
Yes.
buildSrc is a project that is built always before the main build and put to the classpath of all build scripts by being in a parent class loader of the class loader for the build scripts.
This way all dependencies you declare there are available everywhere, but on the other hand it also overrides everything added in a build script classpath as there is no conflict resolution and so on.
And any change in buildSrc invalidates all projects and tasks.
With an included build, things are only built and used if you actually use them and only where you use them and also with conflict resolution just like normal binary plugins you depend on.
If in the included build a plugin is built that you use in a buildscript, then this plugin is actually built and also added to the build script classpath, including its dependencies.
But if you don’t use a plugin from the included build, nothing is built and nothing is added, as that would needlessly invalidate tasks like buildSrc is doing and that would be bad.
The build-logic is an own build the result of which is consumed.
Repository declarations of other builds do not leak into the build that include them.
Each build has to define the repositories where the plugins and dependencies can be resolved from.
So if your plugin needs dependencies that are found on gradlePluginPortal(), you also have to define that on the consuming build as plugin repository.