Unable to build gradle project in Eclipse (using buildship plugin for gradle)

Aim : To create sample gradle project and build it thru eclipse( using buildship plugin)

Step followed : Created new gradle project.

It has LibraryTest.java created already which is not compilable.

Tried building project using command prompt, which has no issues.

But gives below error when tried thru eclipse.

Please help.

FAILURE: Build failed with an exception.

**** What went wrong:***
Task ‘gradle’ not found in root project ‘SampleGradle’.


apply plugin: ‘java’

repositories {
maven {
credentials {
username “"
password "

url “https://repo.mycompany.com

dependencies {
compile ‘org.slf4j:slf4j-api:1.5.6’

testCompile 'junit:junit:4.12'


task showMeCache << {
configurations.compile.each { println it }

(New to gradle)

When you say ‘it has LibraryTest.java created already which is not compilable’ do you mean that it has compilatin errors in Eclipse? Why do try to run a task called gradle?

Ya…I was wrong…Corrected task to build. Able to build the project and the build is successful.
But still the LibraryTest.java show compilation errors in Eclipse.
Dependencies are not seen in ‘Project and External Libraries’