# Gradle dependency for gradle api?

**URL:** <https://discuss.gradle.org/t/gradle-dependency-for-gradle-api/20980>\
**Category:** Help/Discuss\
**Created:** [January 3, 2017, 10:07pm UTC](https://discuss.gradle.org/t/gradle-dependency-for-gradle-api/20980 "2017-01-03T22:07:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![davebender](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@davebender](https://discuss.gradle.org/u/davebender)\
**Post date:** [January 3, 2017, 10:07pm UTC](https://discuss.gradle.org/t/gradle-dependency-for-gradle-api/20980/1 "2017-01-03T22:07:48Z")

</div>

I’m trying to get started building a Gradle plugin in Java (within Eclipse), but I’m stuck trying to define the Gradle dependency. My HelloPlugin says the imports for

`import org.gradle.api.DefaultTask; import org.gradle.api.tasks.TaskAction;`

_cannot be found_, which makes sense because I haven’t told it where to find those dependencies. But I can’t find what value I need to put into my build.gradle dependencies closure. I’ve got:

`dependencies { compile 'org.slf4j:slf4j-api:1.7.21' testCompile 'junit:junit:4.12' }`

I think I need a line like:

`compile 'org.gradle<something else??>`

But I don’t know if that’s correct or what the right value is if I’m going down right path.

Any help would be great. Thanks!

---

<div class="post-metadata">

**Author:** ![davebender](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@davebender](https://discuss.gradle.org/u/davebender)\
**Post date:** [January 4, 2017, 2:40pm UTC](https://discuss.gradle.org/t/gradle-dependency-for-gradle-api/20980/2 "2017-01-04T14:40:48Z")

</div>

I think I found something that works:

`compile gradleApi()`

So if I have:

`dependencies { compile 'org.slf4j:slf4j-api:1.7.21' compile gradleApi() testCompile 'junit:junit:4.12' }`

all seems to work.
