我有两个github pacakges
命名XXX/AAA
和YYY/BBB
(相同OWNER
但不同repository
)。现在,当我尝试将它们添加到我的项目中时,gradle 似乎总是使用第一个存储库。
repositories {
maven { url 'https://jitpack.io' }
maven {
url "https://maven.pkg.github.com/XXX/AAA"
credentials {
username = USERNAME
password = PWD
}
}
maven {
url "https://maven.pkg.github.com/XXX/BBB"
credentials {
username = USERNAME
password = PWD
}
}}
在com.example
实现上也是一样的。
dependencies {
// implementation 'com.example:package'
// AAA
implementation("YYY:AAA:${a_version}")
// BBB
implementation("YYY:BBB:${b_version}")
}
我在同步时收到以下错误
Could not HEAD 'https://maven.pkg.github.com/XXX/AAA/YYY/BBB/0.1/BBB-0.1.pom'. Received status code 400 from server: Bad Request. Disable Gradle 'offline mode' and sync project
我们可以清楚地看到,gradle 使用了错误的存储库(AAA 而不是 BBB)
任何帮助表示赞赏。
提前致谢