Gradle 2.6 没有解决来自 bintray 的依赖
Gradle 2.6 doesn't resolve dependency from bintray
我的构建非常简单:
$ gradle clean test war -b build.gradle
Gradle 说:
:clean UP-TO-DATE
:compileJava
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not find mvc-tools.jar (net.virtalab:mvc-tools:2.1).
Searched in the following locations:
http://dl.bintray.com/virtalab/maven/net/virtalab/mvc-tools/2.1/mvc-tools-2.1.jar
虽然给定 URL 上有 JAR:
$ wget http://dl.bintray.com/virtalab/maven/net/virtalab/mvc-tools/2.1/mvc-tools-2.1.jar
...
HTTP request sent, awaiting response... 200 OK
Length: 27222 (27K) [application/java-archive]
...
$ file mvc-tools-2.1.jar
mvc-tools-2.1.jar: Zip archive data, at least v1.0 to extract
我的 build.gradle 是:
repositories {
//local maven repo if possible
mavenLocal()
//bintray
maven {
url "http://dl.bintray.com/virtalab/maven"
}
//our jcenter cache
maven {
url 'http://maven.virtadev.net/jcenter'
}
}
我已经做了什么?
- 使用 --debug 启动(仍然不知道为什么 gradle 卡住了)
- rm -rf .gradle
最后通过删除 ~/.gradle
目录解决了问题
我的构建非常简单:
$ gradle clean test war -b build.gradle
Gradle 说:
:clean UP-TO-DATE
:compileJava
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not find mvc-tools.jar (net.virtalab:mvc-tools:2.1).
Searched in the following locations:
http://dl.bintray.com/virtalab/maven/net/virtalab/mvc-tools/2.1/mvc-tools-2.1.jar
虽然给定 URL 上有 JAR:
$ wget http://dl.bintray.com/virtalab/maven/net/virtalab/mvc-tools/2.1/mvc-tools-2.1.jar
...
HTTP request sent, awaiting response... 200 OK
Length: 27222 (27K) [application/java-archive]
...
$ file mvc-tools-2.1.jar
mvc-tools-2.1.jar: Zip archive data, at least v1.0 to extract
我的 build.gradle 是:
repositories {
//local maven repo if possible
mavenLocal()
//bintray
maven {
url "http://dl.bintray.com/virtalab/maven"
}
//our jcenter cache
maven {
url 'http://maven.virtadev.net/jcenter'
}
}
我已经做了什么?
- 使用 --debug 启动(仍然不知道为什么 gradle 卡住了)
- rm -rf .gradle
最后通过删除 ~/.gradle
目录解决了问题