Gradle doesn't add the same dependencies to classpath when applying plugins

+1

I faced the same problem (see Using the maven-publish plugin = no dependencies in pom.xml).
The solutions I found were:

  • to systematically added gradleApi() in the consumer script’s buildscript block
  • to add the missing classpath 'foo:bar:baz' dependency only (if I know which ones I need, and if they are not too many)
  • to tweak the generated ivy.xml / mavem.pom of my plugin to reference the needed libraries (as they are not added, which kind of make sense, since otherwise the whole gradleApi content shall be referenced)