gradle 使用maven repository 的设置

repositories {
    //Maven中心库(http://repo1.maven.org/maven2)
    mavenCentral()

    //本地库,local repository(${user.home}/.m2/repository)
    mavenLocal()

    //指定库
    maven {
        url "http://repo.mycompany.com/maven2"
    }

    //指定库
    mavenRepo name: reponame', url: "http://repo.mycompany.com/maven2"

    //指定库
    maven {
        // Look for POMs and artifacts, such as JARs, here
        url "http://repo2.mycompany.com/maven2"
        // Look for artifacts here if not found at the above location
        artifactUrls "http://repo.mycompany.com/jars"
        artifactUrls "http://repo.mycompany.com/jars2"
    }

    //带认证的库
    maven {
        credentials {
            username 'user'
            password 'password'
        }
        url "http://repo.mycompany.com/maven2"
    }
}

猜你喜欢

转载自389047315.iteye.com/blog/2221581