[英]Publish an aar file to Maven Central with Gradle not working
[英]Gradle doesn't find .aar file on Maven repo on Bintray
...即使錯誤報告了正確的下載URL。
(Bintray詳情如下。)
Gradle Repo
repositories {
jcenter()
maven { url 'https://dl.bintray.com/myUsername/myRepo/' }
}
依賴
compile('com.domain.groupid:library-core:v1.2.3@aar') {
transitive=true
}
compile('com.domain.groupid:library-support:v1.2.3@aar') {
transitive=true
}
錯誤
Error:Could not find library-core.aar (com.domain.groupid:library-core:v1.2.3).
Searched in the following locations:
https://dl.bintray.com/myUsername/myRepo/com/domain/groupid/library-core/v1.2.3/library-core-v1.2.3.aar
如果我復制該URL,我可以在簽出窗口中下載它。 為什么Gradle有問題呢?
還有另一個類似的編譯依賴項(這里列為library-support
),但我假設它沒有達到它,因為這個首先失敗了。
設置......
我有一個關於Bintray的個人公共回購,有兩個安卓庫。
https://bintray.com/myUsername/myRepo/library-core
https://bintray.com/myUsername/myRepo/library-support
兩者都有我的庫的gradle腳本中的bintray規則上傳的版本。 版本上傳,我可以在bintray UI中看到它們,我可以下載它們並看到它們是我所期望的:
https://dl.bintray.com/myUsername/myRepo/com/domain/groupid/library-core/maven-metadata.xml
https://dl.bintray.com/myUsername/myRepo/com/domain/groupid/library-core/library-core-v1.2.3/library-core-v1.2.3-sources.jar
https://dl.bintray.com/myUsername/myRepo/com/domain/groupid/library-core/library-core-v1.2.3/library-core-v1.2.3.aar
https://dl.bintray.com/myUsername/myRepo/com/domain/groupid/library-core/library-core-v1.2.3/library-core-v1.2.3.pom
// Same for library-support. All of these download in a signed out window.
gra gra期待別的嗎?
Maven通常不期望version屬性中的v
前綴。 它由坐標語法的順序暗示: <group>:<name>:<version>
。 對版本號使用語義版本控制應該可以解決問題。
我有一個類似的問題,添加另一個答案,希望將來幫助其他人。
在我的情況下,我首先只將.jar文件上傳到maven repo,然后當我上傳.aar文件時,即使錯誤URL正確鏈接到工件,它也找不到它。
添加
--refresh-dependencies
我的gradle命令為我解決了這個問題
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.