Java 如何在Gradle中更新依赖项
任何人都可以告诉我如何在gradle中执行类似于Java 如何在Gradle中更新依赖项,java,maven,intellij-idea,gradle,Java,Maven,Intellij Idea,Gradle,任何人都可以告诉我如何在gradle中执行类似于maven install-U(更新依赖项)的操作 我有问题,我已将新的依赖项添加到build.gradle文件 dependencies { compile('org.springframework.boot:spring-boot-starter-data-jpa') compile('org.springframework.boot:spring-boot-starter-thymeleaf') compile('or
maven install-U
(更新依赖项)的操作
我有问题,我已将新的依赖项添加到build.gradle文件
dependencies {
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
compile('org.springframework.boot:spring-boot-starter-web')
compile("org.springframework.boot:spring-boot-starter-security")
runtime('com.h2database:h2')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
新的依赖项是:
compile("org.springframework.boot:spring-boot-starter-security")
在构建或项目同步期间,我的IntelliJ(版本14)甚至没有尝试下载这个新的依赖项(我使用的是gradle版本2.5)
在maven项目中,IntelliJ具有类似下载maven依赖项的功能。
但对于格雷德尔来说,我看不到这样的事情。这就像我的项目看起来一样
有谁能告诉我为什么我在项目列表中没有看到像maven一样的*.jar
使用IntelliJ 在渐变工具窗口中,单击刷新按钮。屏幕如下: 使用终端 必须将此行添加到
build.gradle
中
apply plugin: 'idea'
接下来,如果您要添加一些依赖项,并且希望同步IntelliJ,则只需使用命令
gradle idea
如果任何人在查找渐变工具窗口时遇到问题,则该窗口位于:
查看|工具窗口| Gradle您可以使用
apply plugin:'idea'
将idea
插件添加到Gradle构建脚本中,然后在添加新的依赖项后运行Gradle idea
。它将下载依赖项。太好了,非常感谢,这非常有帮助,您知道如何从控制台/终端执行此任务吗?