How do I refresh project dependencies using Buildship in Eclipse?

前端 未结 5 1353
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-24 05:51

Eclipse Mars was recently released and I felt like trying it out. It listed tighter integration with Gradle as one of its features via Buildship.

With Luna I was usi

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-24 06:58

    Updating the dependencies that eclipse sees should then be as simple as:

    right click on project -> gradle -> refresh all
    

    Update in buildship 1.0.16

    Currently you need to jump through the delete-and-import hoop the first time you use an existing gradle project with buildship. You can now use the Add Gradle Nature option:

     right click on project -> configure -> Add Gradle Nature
    

    “Refresh Gradle Project” is now also shown when right-clicking on any .gradle file as well as in the context menu of the Gradle editor. source

    See update below However sometimes you may find that when your project was imported, it didn't get the new Project and External Dependencies classpath entry which you would normally be able to see in your Project Properties -> Java Build Path -> Libraries If this is indeed missing, add the following to your project's .classpath file and all the gradle goodness should start working:

    
    

    Update in buildship 1.0.16

    Gradle classpath container is restored if missing

    When converting an existing Eclipse Java project to Gradle, the Gradle classpath container was missing. It is now always added when a project is a Java project.

提交回复
热议问题