# Subproject plugin dependency 

**URL:** <https://discuss.gradle.org/t/subproject-plugin-dependency/40428>\
**Category:** Help/Discuss\
**Created:** [July 8, 2021, 8:29am UTC](https://discuss.gradle.org/t/subproject-plugin-dependency/40428 "2021-07-08T08:29:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hassall](https://avatars.discourse-cdn.com/v4/letter/h/7ab992/32.png) [@Hassall](https://discuss.gradle.org/u/Hassall)\
**Post date:** [July 8, 2021, 8:29am UTC](https://discuss.gradle.org/t/subproject-plugin-dependency/40428/1 "2021-07-08T08:29:29Z")

</div>

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

Directory structure:

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

```

`buildSrc/build.gradle`:

```gradle
plugins {
    id 'java-library'
}
.
.

```

`buildSrc/api/build.gradle`:

```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`:

```gradle
subprojects {
   apply plugin: 'java-library'
}

```

Gradle version: 7.0.2  
Groovy version: 3.0.7
