我正在为我的Android项目自动构建设置Jenkins。 由于VM已禁用Internet,我从以下网址下载了gradle.2.2.2.pom:
https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.pom
在我的build.gradle中,我链接了gradle-2.2.2.pom文件,如下所示:
buildscript {
repositories {
jcenter{
url file("C:/JenkinsSetup/gradle_2.2.2.pom_file/gradle-2.2.2.pom")
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
但是,我仍然收到此错误:
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:2.2.2.
Searched in the following locations:
file:/C:/JenkinsSetup/gradle_2.2.2.pom_file/gradle-2.2.2.pom/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.pom
file:/C:/JenkinsSetup/gradle_2.2.2.pom_file/gradle-2.2.2.pom/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.jar
Required by:
:LocationSensing:unspecified
知道接下来我该怎么办?我已经下载并链接了.pom文件构建系统问我。
答案 0 :(得分:-1)
你应该把gradle-2.2.2.pom放到路径上:
C:/JenkinsSetup/gradle_2.2.2.pom_file/gradle-2.2.2.pom/com/android/tools/build/gradle/2.2.2 /
如果您使用:
url file("C:/JenkinsSetup/gradle_2.2.2.pom_file/gradle-2.2.2.pom")