Subproject plugin dependency

Hi, below is a simplified example of the problem I’m encountering:

Directory structure:

.
├── buildSrc
│   ...
├── api
│   ├── src
│   │   └──...
│   └── build.gradle
└── build.gradle

buildSrc/build.gradle:

plugins {
    id 'java-library'
}
.
.

buildSrc/api/build.gradle:

description = 'api'

dependencies {
    implementation "some.dependency"
}

I receive the following error:

“Could not find method implementation() for arguments… on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler”

I believe the problem is because the plugin ‘java-library’ is loaded after the fact for the api subproject and that’s why the method implementation() can’t be resolved. Is there a work around while still using the DSL plugin convention?

(Note: I do have a non DSL working solution)

buildSrc/build.gradle:

subprojects {
   apply plugin: 'java-library'
}

Gradle version: 7.0.2
Groovy version: 3.0.7