天天看點

Android 快速釋出開源項目到jcenter,出坑日記

篇文章是基于hongyang大神的 Android 快速釋出開源項目到jcenter,參照他的文章,我順利 進了他挖的一些坑(隻是一些小瑕疵)。記錄一下,友善遇到同樣問題的同學出坑。

以下内容都是使用bintray-release插件釋出到jcenter,其他插件請勿對号入座。

1、注冊bintray.com賬号

注冊位址還是那個注冊位址 https://bintray.com/,隻是一定要注意要注冊一個 * Open Source Account* 帳号,如下圖。

Android 快速釋出開源項目到jcenter,出坑日記

2、Repo ‘maven’ was not found

這個需要你提前建立一個名為maven的倉庫。在View Profile 頁面選擇Add New Repository,然後建立 Name = maven,type = maven的倉庫。如下圖

Android 快速釋出開源項目到jcenter,出坑日記
有人說,不是必須先建立這個。你可以先忽略這個,出了問題再來建立也行。>_<

3、 peer not authenticated

如果上傳插件時碰到 peer not authenticated的問題,請将上傳指令分部執行。

改之前

改之後

gradlew clean build
gradlew bintrayUpload -PbintrayUser=xxx -PbintrayKey=xxxxx -PdryRun=false
           
目前不知道為什麼。

以上就是目前碰到的問題,其他問題和解決方案,還勞煩各位看官評論回複。

備注下,有可能這個方法也很好。

https://github.com/msdx/gradle-publish