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
https://discuss.gradle.org/t/i-have-a-question-about-how-the-gradle-eclipse-plugin-fails-to-generate-java-build-path-source-folder-entries?source_topic_id=10190
might help you configuring a global Eclipse classpath that includes subprojects dependencies