简体   繁体   中英

Gradle - use dependency as other project from artifactory

I have 2 gradle projects. A and B. A depends on B. Also I uploaded B as a set of artifacts to the artifactory local server. I used maven publish. Then I try to use B as dependency in A. I`m trying to use it as maven dependency, so I wrote

repositories {
    //  mavenCentral();

    maven {
        url "http://localhost:8081/artifactory/myprjb-common/"
        artifactUrls "http://localhost:8081/artifactory/myprjb-common/"
        credentials {
            username = "admin"
            password = "password"
        }
    }
    jcenter();
}

But, it always try to download jars from repo1. I think I misunderstood something. First of all I don't quite understand why do I need maven, also I don't understand is my artifacts publication equals to maven install. And how to use B as dependency for A? So how I see it: work on B, publish, work on A, pull dependencies from B

感谢您的回答,但是我通过将存储库放入allprojects闭包中进行了修复,目前尚不清楚,因为应该将存储库设置为全局设置,但是无论如何,我将其放置在allprojects闭包中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM