我有以下build.gradle
文件:
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = 1.7
version = '1.0'
repositories {
mavenCentral()
}
dependencies {
compile 'org.springframework:spring-core:4.1.1.RELEASE'
compile 'org.springframework:spring-context:4.1.1.RELEASE'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
我运行以下命令:
$ gradle --refresh-dependencies
,但它什么也不做。依赖项不会更新,也不会反映在类路径上。命令的输出是:
:help
Welcome to Gradle 2.1.
To run a build, run gradle <task> ...
To see a list of available tasks, run gradle tasks
To see a list of command-line options, run gradle --help
BUILD SUCCESSFUL
Total time: 5.999 secs
不过,通过Eclipse gradle插件可以做到这一点。
发布于 2014-11-06 14:55:03
gradle --refresh-dependencies <task>
发布于 2016-02-13 07:37:44
我使用的是Gradle 2.9,并将其用于强制刷新:
gradle build --refresh-dependencies
发布于 2014-11-29 00:47:01
你应该首先使用gradle clean
进行清理,然后使用gradle eclipse
,最后在eclipse中转到项目并刷新项目,它适用于我的项目。
https://stackoverflow.com/questions/26773292
复制相似问题