title: Gradle dependency platform in parent module
body: <p>I have a gradle project with a lot of subprojects and I want a BOM file to apply to all the subprojects.
  I tried to put this in some subproject and it works fine:</p>
  <pre><code>dependencies{
    implementation enforcedPlatform('group:bom-artifact:version')
  }
  </code></pre>
  <p>But when I put it a parent <code>gradle.build</code>, or wrap it like:</p>
  <pre><code>allprojects {
      dependencies {
          implementation enforcedPlatform('group:bom-artifact:version')
      }
  }
  </code></pre>
  <p>It ends with error:</p>
  <pre><code>&gt; Could not find method implementation() for arguments [DefaultExternalModuleDependency{group='group', name='bom-artifact', version='version', configuration='default'}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
  </code></pre>
  <p>Can't figure out what's wrong. How to fix this? Or is there a better way to apply one BOM to all subprojects and manage it from one place?</p>