buildSrc/build.gradle vs buildscript block

I posted this on StackOverflow ( but didn’t get a response. Hoping someone here can clarify:

We have a Gradle build that includes a buildSrc with some custom plugins. Those plugins apply yet other plugins. For example, our plugin applies For annotation processing that library needs to be on Gradle’s classpath during compilation. So, putting this in our main build.gradle works:

buildscript {
    repositories {
    dependencies {
       classpath "$gToolsVersion"

However, that means that for a user to apply this plugin they must (1) apply our plugin and (2) add that buildscript boilerplate. It seems like that shouldn’t be necessary. We can also add a project.buildscript block inside our plugin but that too seems unnecessary and, due to this bug is problematic:

I added the dependency to buildSrc/build.gradle as a runtime dependency. It seems like that should work: I thought that tells Gradle that in order to run my plugin that library (and its dependencies) need to be on the classpath. However, gradle buildEnvironment (and the fact that our build fails) makes it clear that’s not the case.

So, questions:

  1. What’s the difference between a runtime dependency specified in buildSrc/build.gradle and a classpath dependency specified in a buildscript block in a regular build.gradle?
  2. How can I arrange things so that users can apply the plugin from buildSrc and not have to also add the buildscript block to their build.gradle?

Does nobody know the answer to this??

I just put a bounty on the StackOverflow post so now’s your chance to get 50 reputation points!

Did you ever get your buildSrc plugin working?