在 build.gradle 中作为依赖添加时,让依赖 jar 自动添加到 STS 项目

Have dependengy jar automatically add to STS project when added as dependency in build.gradle

我在 https://start.spring.io 创建了一个 Spring 启动应用程序。

我当时添加的依赖都存在。现在我在 STS 中开发应用程序,我必须不时地向 build.gradle 添加依赖项。如何在不手动下载并通过Configure Build Path...添加的情况下将相关jar添加到项目中?

Eclipse中支持Gradle的组件叫做Buildship. To add an new dependency you should modify your build.gradle file and add the dependency in the dependencies {} block. You can then right-click the project and select Gradle -> Refresh Gradle Project as described here。这将下载依赖项(及其所有依赖项),然后更新项目的类路径。