Update my gradle dependencies in eclipse

前端 未结 5 1424
时光取名叫无心
时光取名叫无心 2020-11-30 00:11

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         


        
相关标签:
5条回答
  • 2020-11-30 00:41

    You have to select "Refresh Dependencies" in the "Gradle" context menu that appears when you right-click the project in the Package Explorer.

    0 讨论(0)
  • 2020-11-30 00:47

    Looking at the Eclipse plugin docs I found some useful tasks that rebuilt my classpath and updated the required dependencies.

    • First try 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 file
      • gradle cleanEclipseClasspath to empty the project's classpath
    • Finally gradle eclipse to rebuild the Eclipse configuration
    0 讨论(0)
  • 2020-11-30 00:54

    You 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.

    0 讨论(0)
  • 2020-11-30 00:56

    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 !

    0 讨论(0)
  • 2020-11-30 00:59

    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.

    0 讨论(0)
提交回复
热议问题