Jcenter教程(Android Studio專用)

Android Studio 把自己寫的Lib發(fā)布到Jcenter

第一步:注冊(cè)帳號(hào)

注冊(cè)帳號(hào)地址:

https://bintray.com/signup/oss


第二步:創(chuàng)建倉(cāng)庫(kù)



第三步:獲取bintray帳號(hào)Key



第四步:配置gradle

打開根目錄的gradle


classpath'com.novoda:bintray-release:0.3.4'

打開lib的gradle


applyplugin:'com.novoda.bintray-release'


task javadoc(type: Javadoc) {

options {

encoding"UTF-8"

charSet'UTF-8'

authortrue

versiontrue

links"http://docs.oracle.com/javase/7/docs/api"

}

}

//添加

publish {

userOrg ='lostdeer'//bintray.com用戶名

groupId ='com.mengcb'//jcenter上的路徑

artifactId ='basenetlib'//項(xiàng)目名稱

publishVersion ='1.0.2'//版本號(hào)

desc ='Oh hi, this is a nice description for a project, right?'//描述,不重要

website ='https://github.com/LostDeer/basenetlib'//網(wǎng)站,不重要;盡量模擬github上的地址,例如我這樣的;當(dāng)然你有地址最好了

}

第五步:打開終端

gradlew clean build bintrayUpload -PbintrayUser=用戶名 -PbintrayKey=上面拿到的Key -PdryRun=false(false為真實(shí)提交,true不會(huì)真實(shí)提交)


成功了

第六步:同步到j(luò)center


進(jìn)入看詳情




最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容