Gradle无法从远程maven存储库下载

时间:2014-03-12 13:32:29

标签: android maven intellij-idea gradle

在这里的几个github库中:https://github.com/commonsguy/cwac-endless我找到了存储在亚马逊上的存储库的引用。

repositories {
    maven {
        url "https://repo.commonsware.com.s3.amazonaws.com"
    }
}

dependencies {
    compile 'com.commonsware.cwac:endless:1.2.3'
}

问题是,我不能让它在gradle中从这种存储库下载依赖项。

以下是我的build.gradle文件示例:

buildscript {
    repositories {
        mavenLocal()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.+'
        classpath 'com.github.dcendents:android-maven-plugin:1.0'
    }
}
apply plugin: 'android-library'
apply plugin: 'android-maven'

repositories {
    mavenLocal()
    mavenCentral()
    maven {
        url "http://repo.commonsware.com/"
    }
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.2"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}


dependencies {
    compile 'com.googlecode.android-query:android-query:0.25.9'
    compile 'com.commonsware.cwac:endless:1.2.3'
    compile project(':FontLibrary')
}

我正在使用Intellij Idea 13,结果是:

Gradle 'OSKExplorer' project refresh failed:
         Could not find com.commonsware.cwac:endless:1.2.3.
         Required by:
         OSKExplorer:SwipeListViewComponent:unspecified > OSKExplorer:CommonLibrary:unspecified

4 个答案:

答案 0 :(得分:3)

不知道是否使用https://repo.commonsware.com.s3.amazonaws.com网址为您做了这件事,但我将这个maven {url}置于其中:

allprojects{
    repositories{
        mavenCentral()
        maven{ url "https://repo.commonsware.com.s3.amazonaws.com"}
    }
}

GL!

答案 1 :(得分:2)

将https替换为http,http://repo.commonsware.com.s3.amazonaws.com

它为我工作。

答案 2 :(得分:0)

替换

repositories {

    mavenCentral()
    maven {

        url "https://repo.commonsware.com.s3.amazonaws.com"
    }
    maven {
        url "https://jitpack.io"
    }
}

repositories {

    mavenCentral()
    maven {

        url "http://repo.commonsware.com.s3.amazonaws.com"
    }
    maven {
        url "http://jitpack.io"
    }
}

答案 3 :(得分:0)

网址不正确。使用这个适合我

maven {url "http://s3.amazonaws.com/repo.commonsware.com" }