I have a simple gradle project in my eclipse. I update the build.gradle to include a few apache http jars...
dependencies {
compile group: \'commons-coll
You have to select "Refresh Dependencies" in the "Gradle" context menu that appears when you right-click the project in the Package Explorer.
Looking at the Eclipse plugin docs I found some useful tasks that rebuilt my classpath and updated the required dependencies.
gradle cleanEclipse
to clean the Eclipse configuration completely. If this doesn;t work you may try more specific tasks:
gradle cleanEclipseProject
to remove the .project filegradle cleanEclipseClasspath
to empty the project's classpathgradle eclipse
to rebuild the Eclipse configurationYou have to make sure that "Dependency Management" is enabled. To do so, right click on the project name, go to the "Gradle" sub-menu and click on "Enable Dependency Management". Once you do that, Gradle should load all the dependencies for you.
I tried all above options but was still getting error, in my case issue was I have not setup gradle installation directory in eclipse, following worked:
eclipse -> Window -> Preferences -> Gradle -> "Select Local Installation Directory"
Click on Browse button and provide path.
Even though question is answered, thought to share in case somebody else is facing similar issue.
Cheers !
First, please check you have include eclipse gradle plugin. apply plugin : 'eclipse'
Then go to your project directory in Terminal. Type gradle clean
and then gradle eclipse
. Then go to project in eclipse and refresh the project.