Eclipse Gradle dependency for a war module

I am new to gradle. Was trying to set up a simple web project with gradle eclipse plugin.
I have a root directory and a war sub folder with build.graddle at both the places. Is there anyway I can generate the gradle dependencies in eclipse based on the dependencies declared in build.gradle in war module.

The build is fine and working if I do the gradle build command but not able to set the classpath in eclipse.

This thread
might help you configuring a global Eclipse classpath that includes subprojects dependencies