简体   繁体   English

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

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

I created a Spring Boot application at https://start.spring.io .我在https://start.spring.ZF98ED07A4D5F50F7DE17FZ410D处创建了 Spring 引导应用程序。

The dependencies I added at the time all exist.我当时添加的依赖都存在。 Now that I'm developing the app in STS I have to add dependencies to build.gradle from time to time.现在我正在 STS 中开发应用程序,我必须不时向 build.gradle 添加依赖项。 How can I get the relevant jars to be added to the project without manually downloading them and adding them through Configure Build Path... ?如何在不手动下载并通过Configure Build Path...

The component in Eclipse that supports Gradle is called Buildship . Eclipse 中支持 Gradle 的组件称为Buildship To add an new dependency you should modify your build.gradle file and add the dependency in the dependencies {} block.要添加新的依赖项,您应该修改build.gradle文件并在dependencies {}块中添加依赖项。 You can then right-click the project and select Gradle -> Refresh Gradle Project as described here .然后,您可以右键单击项目和 select Gradle -> Refresh Gradle Project ,如此所述。 This will download the dependency (and all of its dependencies) and then update the classpath of the project.这将下载依赖项(及其所有依赖项),然后更新项目的类路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM